Skip site navigation (1) Skip section navigation (2)

dbsize contrib

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>,Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: dbsize contrib
Date: 2004-08-29 10:27:30
Message-ID: 4131AF92.3080107@pse-consulting.de (view raw or flat)
Thread:
Lists: pgsql-patches
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'

Regards,
Andreas





Attachment: dbsize.diff
Description: text/x-patch (12.7 KB)

Responses

pgsql-patches by date

Next:From: Reini UrbanDate: 2004-08-29 10:49:50
Subject: Re: cygwin 8.0.0beta1 postmaster/syslogger.c, port/dirmod.c,
Previous:From: Andreas PflugDate: 2004-08-29 09:14:54
Subject: Re: log_filename_prefix --> log_filename + strftime()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group