Re: For review: dbsize patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: For review: dbsize patch
Date: 2005-06-27 23:58:29
Message-ID: 200506272358.j5RNwTu15982@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dave Page wrote:
> The attached patch is an update of the dbsize integration patch
> discussed last week. This version includes the following functions:
>
> 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_size_pretty(int8) - Pretty print (and round) the byte size
> specified (eg, 123456 = 121KB)
>
> The only remaining function that last week's brief discussion indicated
> was required is a replacement for total_relation_size() (or
> pg_table_size() as it might now be called). I didn't realise until a few
> minutes ago that this function (which is actually broken because it
> doesn't handle schemas) was only committed a couple of months ago (v1.5,
> http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dbsize/dbsize.s
> ql.in) and has therefore never been in a release version.

Uh, do any of these include the index size? TOAST size?

> So should we include this new feature, and if so, how is it best added -
> rewrite in C, or one long line in pg_proc?

I would follow whatever we do in pg_proc now.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-06-28 00:28:02 Re: Implementing SQL/PSM for PG 8.2
Previous Message Bernd Helmle 2005-06-27 23:43:27 Moving sequences to another schema