Dbsize backend integration

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Dbsize backend integration
Date: 2005-06-28 12:30:31
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E490E7CA@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

The attached patch integrates dbsize functions into the backend, as per
discussion on -hackers. The following functions are included:

pg_relation_size(text) - Get relation size by name/schema.name
pg_relation_size(oid) - Get relation size by OID
pg_tablespace_size(name) - Get tablespace size by name
pg_tablespace_size(oid) - Get tablespace size by OID
pg_database_size(name) - Get database size by name
pg_database_size(oid) - Get database size by OID
pg_table_size(text) - Get table size (including all indexes and
toast tables) by name/schema.name
pg_table_size(oid) - Get table size (including all indexes and
toast tables) by OID
pg_size_pretty(int8) - Pretty print (and round) the byte size
specified (eg, 123456 = 121KB)

This is based on the dbsize contrib module, and previous patches from
Andreas Pflug and Ed L.

The dbsize module should be removed once this is applied, and the
catalog version incremented as I haven't included that in the patch.

Regards, Dave.

Attachment Content-Type Size
dbsize.c application/octet-stream 11.2 KB
dbsize.patch application/octet-stream 9.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-06-28 12:30:44 Re: Problem with dblink regression test
Previous Message Dave Cramer 2005-06-28 12:03:12 Re: Implementing SQL/PSM for PG 8.2

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2005-06-28 12:30:44 Re: Problem with dblink regression test
Previous Message Petr Jelinek 2005-06-28 12:27:49 per user/database connections limit again