Using psql, how can I disconnect from an established connection without logging out?
To be more specific: Assuming the database server runs on localhost, I connect to the db server using
psql -U <user>
after that I am in the PSQL console. From there I can connect to one of the databases using
<user>=# \connect <database>
Now here is the question: How can I disconnect from this session without logging of from PSQL Console? I tried \disconnect
but without any luck and using \q
not only closes the session but kicks me out of PSQL entirely.
So is there a command which allows me to disconnect from one database and to reconnect to another database (using \connect <another_database>
) without logging of from/ shutting down PSQL?