Re: Querying database size

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: Benjamin Krajmalnik <kraj(at)illumen(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Querying database size
Date: 2006-07-07 17:54:49
Message-ID: Pine.LNX.4.64.0607071053310.3599@glacier.frostconsultingllc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

If you have 8.1.x you can do something like this:

SELECT pg_size_pretty(database_size('<database name>'));

example:

SELECT pg_size_pretty(database_size('testdb'));

If you have another version of postgres, check out the dbsize contrib module.

On Fri, 7 Jul 2006, Benjamin Krajmalnik wrote:

> Is there a query which can be issued which will return the size of a
> database?
> I see that in pgadmin you can get the values on a per table manner.
> I have looced at the pg_catalog schema, but to be truthful I cannot
> figure out how to get that information.
>
> TIA,
>
> Benjamin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
>

--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Frost 2006-07-09 20:32:47 Re: How are ppl monitoring PostgreSQL ... ? What is being
Previous Message Chris Hoover 2006-07-07 17:50:48 Re: Querying database size