Today is my first day of playing with the postgres commandline client psql.
My first task was completed (renaming a database) and I wanted to leave the client.
The answer is to type
\q, as a Postgres novice this was non-obvious!
Things that did not work;