larrybotha
10/31/2014 - 10:44 AM

Useful Commands in PSQL

Useful Commands in PSQL

Useful Commands in PSQL

Taken from Navigating Postgresql with Psql Command Line – 10 Simple Commands and YoLinux Tutorial: The PostgreSQL Database and Linux

\l                        # List databases
\c database-name          # Connect to database
\c                        # Show the database your are connected to
\d                        # List tables in database
\d table-name             # Describe table
\e                        # Edit current command
\z                        # list permissions for current user
\q                        # exit psql
\h                        # get psql help
SELECT * FROM table-name  # List table contents