Commit Graph

5 Commits

Author SHA1 Message Date
Bruce Momjian 4f51368bad Add routines to dbsize to return the index size and total relation size.
Improve documentation.

Ed L.
2005-02-26 23:31:15 +00:00
Tom Lane d9b68c8061 Code review for recent dbsize changes. Fix some thinkos, enforce coding
style and message style standards, improve documentation.
2004-09-28 19:35:43 +00:00
Bruce Momjian 528ac10c7c 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
2004-09-02 00:55:22 +00:00
Tom Lane 688781d450 Fix contrib/dbsize for schema-qualified table names. 2002-04-02 01:17:28 +00:00
Bruce Momjian ad0787b2bd I've written on like that a while ago:
http://webmail.postgresql.org/~petere/dbsize.html

The tarball can be rolled into contrib -- now that I think of it I don't
know why I never did that.

Never imagined this would have anything to do with that TODO item,
though.
I figured oid2name accomplished that.

Peter Eisentraut   peter_e@gmx.net
2002-02-22 23:05:35 +00:00