Re: how to know the current size of a database

From: Decibel! <decibel(at)decibel(dot)org>
To: son(at)raider(dot)co(dot)nz
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to know the current size of a database
Date: 2007-09-19 14:41:07
Message-ID: 0BCD6C8C-E1F9-44AC-82E3-EF0F9C2696EE@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sep 19, 2007, at 5:36 AM, son(at)raider(dot)co(dot)nz wrote:
> I want to know about the size of my database. For example, I want
> to know
> how many Mb of data for current myDatabase database in a postgres
> server.

If you don't need an exact size, this query will be a lot faster than
the size functions:

SELECT pg_size_pretty(sum(relpages)*8192) FROM pg_class;
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-09-19 14:47:05 Re: For index bloat: VACUUM ANALYZE vs REINDEX/CLUSTER
Previous Message Magnus Hagander 2007-09-19 14:40:18 Re: Version 8.2.5 for Windows doesn't startup normallyafter upgrading from 8.2.4