Show all tables and their sizes, largest first
SELECT relname, pg_size_pretty(pg_total_relation_size(relid)) FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;
Create a new PostgreSQL user and database
Show columns, types, and constraints of a table
Export a PostgreSQL table to a CSV file
Find rows with duplicate values in a column