7

I'm new to psql and using psql command line on Ubuntu. What is the command to logout/exit from command line?

Thank you!

Vajira Lasantha
  • 2,335
  • 3
  • 21
  • 35

1 Answers1

20

type \q and press enter to quit from psql from command line. In general the meta commands are preceded by \ for eg- \list or \l: list all databases or \dt: list all tables in the current database

To switch databases:

\connect database_name

If that does not work, you can use CTRL + D. For more help on meta commands you can press \?

Since you are new to psql consider referring to the documentation here

inquisitive
  • 3,558
  • 6
  • 26
  • 54