What command or short key can I use to exit the PostgreSQL command line utility psql
?
Exiting psql Using a Meta-Command The meta-command for exiting psql is \q .
Use \! cls to clear screen.
Description. psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. Alternatively, input can be from a file or from command line arguments.
Type \q
and then press ENTER
to quit psql
.
UPDATE: 19-OCT-2018
As of PostgreSQL 11, the keywords "quit
" and "exit
" in the PostgreSQL command-line interface have been included to help make it easier to leave the command-line tool.
My usual key sequence is:
quit() quit exit() exit q q() !q ^C help Alt + Tab google.com Quit PSQL \q
I think veterans of the psql command line usually shorten that to just:
\q
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With