Trying to quit with \q; gives an error:

The help note says:

Now type: ALTER USER postgres WITH PASSWORD 'testpass'; - hit RETURN, type \q; 

but you don't want the ; on the end otherwise it gives you:

postgres=# \q;
Invalid command \q;. Try \? for help.

Quit Postgres with \q not \q;