Postgresql Conocer el tamaño de la DB y el total

SELECT pg_database.datname, pg_database_size(pg_database.datname), pg_size_pretty(pg_database_size(pg_database.datname)) FROM pg_database ORDER BY pg_database_size DESC;

SELECT pg_size_pretty(sum(pg_database_size(pg_database.datname))::bigint) FROM pg_database;

A buen entendedor pocas palabras 😉