How to exit from PostgreSQL command line utility: psql

App Work picture App Work · Feb 27, 2012 · Viewed 657.5k times · Source

What command or short key can I use to exit the PostgreSQL command line utility psql?

Answer

Frankline picture Frankline · Feb 27, 2012

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.