postgresql check size of database code example
Example 1: postgres check size table
SELECT pg_size_pretty( pg_total_relation_size('tablename') );
Example 2: postgres get size of database
SELECT pg_size_pretty( pg_database_size('dbname') );
SELECT pg_size_pretty( pg_total_relation_size('tablename') );
SELECT pg_size_pretty( pg_database_size('dbname') );