pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
growth of the database
3+ messages / 3 participants
[nested] [flat]

* growth of the database
@ 2007-03-21 17:25  Karthikeyan Sundaram <skarthi98@hotmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Karthikeyan Sundaram @ 2007-03-21 17:25 UTC (permalink / raw)
  To: pgsql-admin@postgresql.org; pgsql-sql

Hi,

     Our database is growing fast.  I want to create a cronjob that should 
tell me what is the current size of the database on each day.

    How can I find this from the database? Is there any pre-written scripts 
written by somebody to share?

Regards
skarthi

_________________________________________________________________
Live Search Maps – find all the local information you need, right when you 
need it. http://maps.live.com/?icid=hmtag2&FORM=MGAC01




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

* Re: growth of the database
@ 2007-03-21 17:37  Guido Neitzer <lists@event-s.net>
  parent: Karthikeyan Sundaram <skarthi98@hotmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Guido Neitzer @ 2007-03-21 17:37 UTC (permalink / raw)
  To: Karthikeyan Sundaram <skarthi98@hotmail.com>; +Cc: pgsql-admin@postgresql.org; pgsql-sql

On 21.03.2007, at 11:25, Karthikeyan Sundaram wrote:

>     Our database is growing fast.  I want to create a cronjob that  
> should tell me what is the current size of the database on each day.
>
>    How can I find this from the database? Is there any pre-written  
> scripts written by somebody to share?

Be aware of linebreaks ...

[Galadriel: cug ] cug $ psql -U postgres -c "select pg_size_pretty 
(pg_database_size('testdb'));"

pg_size_pretty
----------------
495 MB
(1 row)




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

* Re: growth of the database
@ 2007-03-22 10:40  Hubertus Freiherr von Fuerstenberg <hubertus.fuerstenberg@ise.fraunhofer.de>
  parent: Karthikeyan Sundaram <skarthi98@hotmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Hubertus Freiherr von Fuerstenberg @ 2007-03-22 10:40 UTC (permalink / raw)
  To: pgsql-sql

Karthikeyan Sundaram wrote:
> Hi,
> 
>     Our database is growing fast.  I want to create a cronjob that 
> should tell me what is the current size of the database on each day.
> 
>    How can I find this from the database? Is there any pre-written 
> scripts written by somebody to share?
> 

Hi,
there is an administrative function called pg_database_size(name), as in 
SELECT pg_database_size('mydb'); which returns the disk space used by 
the database with the specified name.

See Chapter 9.20.

cheers,
Hubertus
-- 
Hubertus v. Fuerstenberg
                    MAIL: Fraunhofer Institute for Solar Energy Systems
                          Heidenhofstr. 2, 79110 Freiburg, Germany
                    PHONE: +49 (761) 4588 5153 FAX: +49 (761) 4588 9286
                    EMAIL: hubertus.fuerstenberg@ise.fraunhofer.de
  --- Quis custodiet ipsos custodes? ---



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


end of thread, other threads:[~2007-03-22 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-21 17:25 growth of the database Karthikeyan Sundaram <skarthi98@hotmail.com>
2007-03-21 17:37 ` Guido Neitzer <lists@event-s.net>
2007-03-22 10:40 ` Hubertus Freiherr von Fuerstenberg <hubertus.fuerstenberg@ise.fraunhofer.de>

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