Calculating database sizes using a script

From: "Machiel Richards" <machielr(at)rdc(dot)co(dot)za>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Calculating database sizes using a script
Date: 2010-03-23 09:08:46
Message-ID: 00b001caca68$74335090$5c99f1b0$@co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all

I have a client that is running a total of 190 Postgresql databases.

I am busy with an audit on the database sizes, performance
tuning,etc...

However to check the database sizes is quite tedious as some
of the servers are running up to 24 databases on one instance.

Due to security restrictions I am not yet able to use
pgadmin / pgphpadmin and need to manually calculate this using 'SELECT
pg_size_pretty(pg_database_size(''));'

Is there a way of running this in a script for each database
in the instance without having to manually type in each database name?

For instance. Let the script extract the database names and
then check the sizes printing it to an output file / screen?

Machiel

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2010-03-23 09:50:40 Re: Calculating database sizes using a script
Previous Message Jasen Betts 2010-03-23 08:46:37 Re: How do you query all columns and all tables for a specific string