I'm new to psql and using psql command line on Ubuntu. What is the command to logout/exit from command line?
Thank you!
To back up, a PostgreSQL database, start by logging into your database server, then switch to the Postgres user account, and run pg_dump as follows (replace tecmintdb with the name of the database you want to backup). By default, the output format is a plain-text SQL script file.
Use \! cls to clear screen.
To disconnect from a database, click the connection in the Database Navigator or Projects view, and then click the Disconnect button in the toolbar or click Database -> Disconnect on the main menu: You can also right-click the connection and click Disconnect on the context menu.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With