When I use terminal, enter my database and then quit by using \q I can not get to the following line in order for example to enter my other database (see below). The cursor is stuck without having the option to get to the next line.

postgres-# \q
Saving session...
...copying shared history...
...saving history...truncating history files...
[Process completed]   

And then I can not go to next line. How do I overcome that problem?

1 Answer 1


First of all, you can switch to another database without leaving psql at all, use \c (or \connect) commad.

From psql's help (always available via \? command):

  \c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}

So just type \c another_db to switch to "another_db".

Next, you see "[Process completed]" because you start psql via some shortcut your Postgres package (brew? postgres.app?) provided.

You can launch Terminal or iTerm2 (not default app in MacOS, but highly popular substitution for default Terminal), and then run psql inside it. In this case, you will not lose the window after \q command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.