Search Postgresql Archives

Detemine database size on Postgres 8.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux