Montag, 15. Februar 2010

How to determine the size of all postgres databases

A manic Monday, reading log files, a big WTF: No space left on device external backups... WTF? .... 5 Minutes later: found a reason: The backups of the test database server... 30 databases on this machine.... which ones are the biggest?

This query to the rescue:
select databases.datname, pg_database_size(databases.datname)/1024/1024 as size from (SELECT datname as datname FROM pg_database) as databases ORDER BY size DESC;

One test database with 1,4GB ... another one with 0.9G... WTF? - Drop database... war is over

  © Blogger template 'Morning Drink' by Ourblogtemplates.com 2008

Back to TOP