En #Postgresql. Despliega, el esquema de la tabla, tamaño total en formato humano, nombre de la tabla, numero de registros por tabla.
SELECT nspname || ‘.’ || relname AS “relation”,
pg_size_pretty(pg_total_relation_size(C.oid)) AS “total_size”, relname, reltuples
FROM pg_class C
LEFT JOIN pg_namespace N
ON (N.oid = C.relnamespace)
WHERE nspname NOT IN (‘pg_catalog’, ‘information_schema’)
AND C.relkind <> ‘i’
AND nspname !~ ‘^pg_toast’
AND relnamespace = n.oid
AND relkind = ‘r’ AND n.nspname = ‘public’
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 587;
Eso es todo espero les sirva. Nos vemos