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

From: momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server: The current implementation of dbsize doesn't handle tables
Date: 2004-09-02 00:55:22
Message-ID: 20040902005522.59FD85E4722@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2004-09-02 01:04:00 pgsql-server: This patch attempts to fix the issue with localized
Previous Message Tom Lane 2004-09-02 00:22:16 pgsql-server: Remove obsolete comment.