pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Shyam Sunder Rai <ssrai@ismartpanache.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Table size
Date: Thu, 14 Jun 2007 07:16:21 -0600
Message-ID: <20070614131621.GA70209@winnie.fuhr.org> (raw)
In-Reply-To: <20070614123030.045191C8026@smtpauth01.csee.onr.siteprotect.com>
References: <20070614123030.045191C8026@smtpauth01.csee.onr.siteprotect.com>

On Thu, Jun 14, 2007 at 06:10:15PM +0530, Shyam Sunder Rai wrote:
> How can I calculate a table size in postgres ? 

To find the size of an existing table use pg_relation_size() or
pg_total_relation_size() (8.1 and later; in earlier versions use
the functions in contrib/dbsize).

http://www.postgresql.org/docs/8.2/interactive/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE

Or did you want to estimate the size of a table given the number
and types of its columns and the number of rows?

-- 
Michael Fuhr



view thread (5+ messages)  latest in thread

Message-ID: <20070614131621.GA70209@winnie.fuhr.org>
Permalink:  ../20070614131621.GA70209@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20070614131621.GA70209@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: mike@fuhr.org, ssrai@ismartpanache.com
  Subject: Re: Table size
  In-Reply-To: <20070614131621.GA70209@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox