postgres=# select sum(pg_database_size('postgres'))::int8 from gp_dist_random('gp_id'); sum ---------------- 16006753522624 (1 row) postgres=# select pg_database_size('postgres'); pg_database_size ------------------ 16006763924106 (1 row)