Detemine database size on Postgres 8.0 - Mailing list pgsql-general

From Thom Brown
Subject Detemine database size on Postgres 8.0
Date
Msg-id bddc86150903020725k45b66044n386d47cab9574f31@mail.gmail.com
Whole thread Raw
Responses Re: Detemine database size on Postgres 8.0  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Reid Thompson
Date:
Subject: Re: Matching against a field case in-sensitive.
Next
From: "Hiroshi Saito"
Date:
Subject: Re: encoding of PostgreSQL messages