Database
PostgreSQL Commands
Work with PostgreSQL from the command line. Learn psql commands, query execution, and database administration.
23 commands
Pro Tips
Use '\?' in psql for help on slash commands, '\h' for SQL help.
Use '\timing' to show query execution time - useful for performance tuning.
Export queries to CSV with '\copy (SELECT ...) TO 'file.csv' WITH CSV HEADER'.
Common Mistakes
DROP DATABASE and DROP TABLE are irreversible. Always backup before destructive operations.