Re: size in bytes of a table?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Harrison <mh(at)pixar(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: size in bytes of a table?
Date: 2005-02-11 18:43:34
Message-ID: 12514.1108147414@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mark Harrison <mh(at)pixar(dot)com> writes:
> I'd like to present some statistics on our database tables,
> showing the number of rows and approximate amount of data
> in bytes, e.g. something like this from one of our other
> databases:

> tasks (546916 Kb,62018 rows)

> Exact numbers don't matter, I just want to present a feel
> for the amount of data we have.

Do a vacuum and then SELECT relname, relpages * 8K, reltuples FROM pg_class

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-02-11 18:48:35 Re: [GENERAL] WARNING: could not remove database directory
Previous Message Bruce Momjian 2005-02-11 18:43:31 Re: [GENERAL] WARNING: could not remove database directory