how to know a table size ?

Started by Alain Rogerabout 19 years ago2 messagesgeneral
Jump to latest
#1Alain Roger
raf.news@gmail.com

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

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Alain Roger (#1)
Re: how to know a table size ?

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