Search Postgresql Archives

Re: How can I known the size of a database, table by table ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The space occupied by your database and tables can be found this way:

# select oid from pg_database where datname='mybase';

 oid 
-------
 17239
(1 row)

$ du -hs data/base/17239
13.5 M

For getting a table size to get an approx size you can do the following:

SELECT relpages * 8192 AS size_in_bytes
FROM pg_class
WHERE

relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = '<schema name>') AND

   relname = '<table name>';

/Shoaib



On 3/27/06, Bruno Baguette < pgsql-ml@xxxxxxxxxxxx> wrote:
Hello,

I works on a PostgreSQL 8.0.4 database, and I would like to known the
size (in bytes, Mbytes or anything else) of that database, for each table.

How can I do that ?

Thanks in advance !

--
Bruno BAGUETTE

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux