Hi all,
We have a database server which is on version 8.0.12. I was wondering if anyone knows of a way to tell the size of each database?
I've tried:
select pg_size_pretty(pg_database_size('test'));
which doesn't work because pg_database_size is unrecognised. And I've tried:
select *
from (
select pc.RelName as "ObjectName"
,pt.spclocation || '/' || pc.relfilenode as "PhysLoc"
,pc.relfilenode as "DirNum"
,pc.relkind as "ObjectType"
,(pc.relpages * 8)/1024 as "MBUsed"
,pc.reltuples as "NumRows"
from pg_roles pr
join pg_class pc
on pr.oid = pc.relowner
join pg_tablespace pt
on pr.oid = pt.spcowner
and pc.reltablespace = pt.oid
where pr.rolname = 'EMS_SA'
and pc.relkind in ('r','i')
order by pc.relname
) a
where 1 = 1
--and "DirNum" = 66252
--and "ObjectName" like '%Encrypted_Data%'
and "ObjectType" = 'r'
order by "MBUsed" desc
,"NumRows" desc
which doesn't work because pg_roles doesn't exist.
Thanks
Thom