pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Querying database size
3+ messages / 3 participants
[nested] [flat]

* Querying database size
@ 2006-07-07 17:17  Benjamin Krajmalnik <kraj@illumen.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Benjamin Krajmalnik @ 2006-07-07 17:17 UTC (permalink / raw)
  To: pgsql-admin

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Querying database size
@ 2006-07-07 17:50  Chris Hoover <revoohc@gmail.com>
  parent: Benjamin Krajmalnik <kraj@illumen.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Chris Hoover @ 2006-07-07 17:50 UTC (permalink / raw)
  To: Benjamin Krajmalnik <kraj@illumen.com>; +Cc: pgsql-admin

On 7/7/06, Benjamin Krajmalnik <kraj@illumen.com> 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
>


select datname, pg_database_size(datname) from pg_database;

This assumes your are running 8.x (might be 8.1.x).

chris

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Querying database size
@ 2006-07-07 17:54  Jeff Frost <jeff@frostconsultingllc.com>
  parent: Benjamin Krajmalnik <kraj@illumen.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jeff Frost @ 2006-07-07 17:54 UTC (permalink / raw)
  To: Benjamin Krajmalnik <kraj@illumen.com>; +Cc: 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@frostconsultingllc.com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-07-07 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07 17:17 Querying database size Benjamin Krajmalnik <kraj@illumen.com>
2006-07-07 17:50 ` Chris Hoover <revoohc@gmail.com>
2006-07-07 17:54 ` Jeff Frost <jeff@frostconsultingllc.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox