Re: Disk space occupied by a table in postgresql - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Disk space occupied by a table in postgresql
Date
Msg-id 20080809091927.GA8430@depesz.com
Whole thread Raw
In response to Disk space occupied by a table in postgresql  (aravind chandu <avin_friends@yahoo.com>)
List pgsql-general
On Sat, Aug 09, 2008 at 12:18:46AM -0700, aravind chandu wrote:
>                     I installed postgresql on linux system, I create a
>                     table and inserted a large data into the table
>                     what I would like to know is how to calculate the
>                     disk space occupied by the table .Is there any
>                     procedure to find it out or simply a command
>                     .Please give me some suggestion.

select pg_relation_size('table_name');
or
select pg_total_relation_size('table_name');

both return size in bytes.

pg_total_relation_size includes disk space used by indexes and external
storage (long texts are kept not in table datafile, but in separate
"toast" tables).

Best regards,

depesz

--
Linked in: http://www.linkedin.com/in/depesz
jid/gtalk: depesz@depesz.com
aim:       depeszhdl
skype:     depesz_hdl

pgsql-general by date:

Previous
From: "Fouad Zaryouh"
Date:
Subject: Re: Disk space occupied by a table in postgresql
Next
From: Andreas Kretschmer
Date:
Subject: Re: Disk space occupied by a table in postgresql