List of command that might be useful
Command | Description |
\conninfo | Displays information about the current database connection. |
\l or \list | Lists all databases in the PostgreSQL server. |
\c [database_name] | Connects to another database. |
\dt | Lists all tables in the current database. |
\dt *.* | Lists all tables in all schemas of the current database. |
\d [table_name] | Describes the structure of a table. |
\d+ [table_name] | Provides more detailed information about a table. |
\dn | Lists all schemas in the current database. |
\du | Lists all users and roles with their permissions. |
SELECT * FROM [table_name]; | Displays the content of a specified table. |
SELECT current_user; | Displays the name of the current user. |
SELECT current_database(); | Displays the name of the current database. |
\dv | Lists all views in the current database. |
EXPLAIN [query]; | Shows the execution plan of a query. |
\df | Lists all functions in the current database. |
\? | Displays help for psql commands. |
\h | Displays help for SQL commands. |