| Command | Info |
|---|---|
\a |
Toggle aligned/unaligned rows (default aligned) |
\x |
Toggle expanded output (default off) |
\H |
Toggle html output (default off) |
\t |
Show only rows (default off) |
| Command | Info |
|---|---|
\l |
List all databases |
\d |
Describe table (Print table structure) |
\du |
List users |
\q |
Quit psql |
| Command | Info |
|---|---|
SELECT * FROM users ORDER BY id DESC LIMIT 20; |
List with limit |
SELECT * FROM "userProject" ORDER BY id DESC LIMIT 20; |
Double quote for camelCase with postgres |
| Command | Info |
|---|---|
\i |
Execute commands from file |
\o |
Send all query results to file or |