How to Exit psql Command Line

PostgreSQL provides an interactive command line utility for it’s users. Mostly it’s called as psql. You can run SQL queries from psql command line tool, also statements like \d too. In this article we are going to cover how to exit from PostgreSQL command line.

Answer of question “how to exit from PostgreSQL command line?” changes between the versions. Not a deep change, but new options added after PostgreSQL 11. Alright, let’s try to answer question, how to exit psql command line.

Simply:

\q

PostgreSQL’s backslash commands are very useful (like \d, \dt etc.) You can use \q to quit psql’s command line.

How to Exit psql Command Line

As an alternative you can use quit and exit too:

quit
exit

As you see, there are three most common options to exit from PostgreSQL command line.

If you have a question or something to add, please leave a comment below.

A new post everyday, subscribe now and don’t miss it!

Subscribe to our newsletter for cool news

Hi! I’m an IT Specialist

I want to hear from you! I am Working with enterprises for 10+ years to improve their infrastructure and efficiency.

Get in touch with me.

Leave a Reply

Discover more from Empower. Innovate. Transform.

Subscribe now to keep reading and get access to the full archive.

Continue reading