Get the size of a database select relname as relname, pg_size_pretty(sum(relpages) * 8192) as size from pg_class group by relname;