psql commands

PHOTO EMBED

Tue Jul 05 2022 19:30:37 GMT+0000 (Coordinated Universal Time)

Saved by @organic_darius

# Open the PostgreSQL interactive terminal
psql 

# Open it on an existing DB
psql db_name

##### While in the psql terminal
# Exit the psql
\q

# List all the DBs
\l

# Connect to one of the DBs
\c db_name

# Show the tables of a DB
\dt

# Check the connection info
\conninfo

# See the help page
\?
  
# Get help for the SQL commands
\h
#or
\h <COMMAND_NAME>
content_copyCOPY