Thread: how to know a table size ?

how to know a table size ?

From
"Alain Roger"
Date:
Hi,

I would like display in my PHP application the size of each table.
So, how can i get the table size (for example in Mb) ?

thanks a lot,

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

Re: how to know a table size ?

From
"A. Kretschmer"
Date:
am  Wed, dem 28.03.2007, um 19:02:40 +0200 mailte Alain Roger folgendes:
> Hi,
>
> I would like display in my PHP application the size of each table.
> So, how can i get the table size (for example in Mb) ?

There are some functions, read:
http://www.postgresql.org/docs/current/interactive/functions-admin.html

For instance: pg_database_size(name), pg_relation_size(text),
pg_total_relation_size(text)


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net