Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id F3B729FB9EA for ; Thu, 14 Jun 2007 10:16:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 21396-02 for ; Thu, 14 Jun 2007 10:16:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 90B879FBDAF for ; Thu, 14 Jun 2007 10:16:27 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l5EDGLZb004524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jun 2007 07:16:24 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l5EDGLFd070261; Thu, 14 Jun 2007 07:16:21 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l5EDGLSZ070260; Thu, 14 Jun 2007 07:16:21 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 14 Jun 2007 07:16:21 -0600 From: Michael Fuhr To: Shyam Sunder Rai Cc: pgsql-admin@postgresql.org Subject: Re: Table size Message-ID: <20070614131621.GA70209@winnie.fuhr.org> References: <20070614123030.045191C8026@smtpauth01.csee.onr.siteprotect.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070614123030.045191C8026@smtpauth01.csee.onr.siteprotect.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/113 X-Sequence-Number: 25781 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