3 ms·
Postgres \ commands are incredible shortcuts that are a pain to write in sql. E.g. \dt+ translates to SELECT schemaname, tablename, tableowner, ta
by nikita 3y ago
Postgres \ commands are incredible shortcuts that are a pain to write in sql. E.g.
\dt+ translates to
SELECT
schemaname,
tablename,
tableowner,
tablespace,
pg_size_pretty(pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename))) AS total_size
FROM pg_tables
ORDER BY pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)) DESC;