January 22nd, 2012 by depesz | Tags: , , , , , , , | Comments Off on Waiting for 9.2 – NULLS from pg_*_size() functions

On 19t of January, Heikki Linnakangas committed patch: Make pg_relation_size() and friends return NULL if the object doesn't exist. That avoids errors when the functions are used in queries like "SELECT pg_relation_size(oid) FROM pg_class", and a table is dropped concurrently. Phil Sorber

If you have production DB servers, chances are you're running variant of these queries: SELECT sum(pg_relation_size(oid)) from pg_class where relkind = 'i' SELECT sum(pg_relation_size(oid)) from pg_class where relkind = 'r' To get summarized size of tables and/or indexes in your database (for example ...

February 2nd, 2010 by depesz | Tags: , , , , , , , , | Comments Off on Waiting for 9.0 – table and index sizes

On 19th of January Tom Lane committed really brilliant patch: Log Message: ----------- Add pg_table_size() and pg_indexes_size() to provide more user-friendly wrappers around the pg_relation_size() function. Bernd Helmle, reviewed by Greg Smith