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,435
  • 3
  • 23
  • 39
  • 1
    This is all documented in the manual: http://www.postgresql.org/docs/current/static/app-psql.html –  May 25 '15 at 07:11

1 Answers1

21

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,738
  • 6
  • 30
  • 56