How can I exit/logout from PostgreSQL?

29,177

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

Share:
29,177
Vajira Lasantha
Author by

Vajira Lasantha

I’m a web application developer and familiar with web technologies like HTML, CSS, JavaScripts, jQuery, jQuery mobile, Bootstrap, Responsive design, PHP, MySQL, Ajax, CMS (ModX, WordPress), FBML, Mobile web apps, Codeigniter (MVC) and MySQL. As a programmer I can handle languages like JAVA, C#.NET, VB.NET and I have sounds knowledge in ASP.NET, WCF, WPF. Networking with Ubuntu server 11/12, ISC DHCP, Bind DNS (static/dynamic), Samba AD, Squid Proxy with content filtering and authentication with AD, Mail servers (Postfix & Dovecot), Webmail, VPN and Tunnelling, Linux iptables, Apache https configuration with SSL (openssl) and certificates including virtual host, VMWare, Citrix, Go-Globle, Cisco routers and switches configurations including LAN/WAN protocols, VLANs, etc. Also, I'm an electronic hobbyist and I do programming with Arduino.

Updated on May 25, 2020

Comments

  • Vajira Lasantha
    Vajira Lasantha almost 4 years

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

    Thank you!