PostgreSQL (psql) Keyboard Shortcuts & Commands (7)
7 PostgreSQL (psql) shortcuts and commands.
Search all shortcuts interactively
Open Shortcut FinderAll Shortcuts
Commands
| Shortcut | Action | Description |
|---|---|---|
| psql -U user -d dbname | Connect | Connect to PostgreSQL. |
| \\l | List DBs | List all databases. |
| \\c [DB] | Switch DB | Switch database. |
| \\dt | List tables | List tables. |
| \\d [table] | Table detail | Show table structure. |
| \\q | Quit | Exit psql. |
| \\i [file] | Execute file | Execute an SQL file. |