Postgres One Liners

1. Show database size

SELECT pg_size_pretty(pg_database_size('dbname')) As fulldbsize;

2. Show table size

SELECT pg_size_pretty(pg_total_relation_size('tablename'));

(more…)