pgsql-server: The current implementation of dbsize doesn't handle tables - Mailing list pgsql-committers

From momjian@svr1.postgresql.org (Bruce Momjian)
Subject pgsql-server: The current implementation of dbsize doesn't handle tables
Date
Msg-id 20040902005522.59FD85E4722@svr1.postgresql.org
Whole thread Raw
Responses Re: pgsql-server: The current implementation of dbsize doesn't handle tables  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-committers
Log Message:
-----------
The current implementation of dbsize doesn't handle tables in
tablespaces correctly, and is quite restricted on objects covered (only
tables and databases, but not tablespaces and indexes).

The attached patch contributes:

- database_size(name)
- relation_size(text)
These are the well-known functions, tablespace-aware.

- pg_tablespace_size(oid)
- pg_database_size(oid)
- pg_relation_size(oid)
Tablespace-aware implementations, used by the upper functions.
pg_relation_size will report sizes of indexes as well.

- pg_size_pretty(bigint)
Formatting of sizes, to display '146MB' instead of '152885668'

Andreas Pflug

Modified Files:
--------------
    pgsql-server/contrib/dbsize:
        dbsize.c (r1.12 -> r1.13)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dbsize/dbsize.c.diff?r1=1.12&r2=1.13)
        dbsize.sql.in (r1.2 -> r1.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dbsize/dbsize.sql.in.diff?r1=1.2&r2=1.3)

pgsql-committers by date:

Previous
From: tgl@svr1.postgresql.org (Tom Lane)
Date:
Subject: pgsql-server: Remove obsolete comment.
Next
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql-server: This patch attempts to fix the issue with localized