Skip site navigation (1) Skip section navigation (2)

Re: Execute VACUUM FULL when DB touches a specific size ?

From: Vibhor Kumar <vibhor(dot)aim(at)gmail(dot)com>
To: Nilesh Govindarajan <lists(at)itech7(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Execute VACUUM FULL when DB touches a specific size ?
Date: 2010-04-05 06:06:10
Message-ID: F9EC77F8-98C6-4492-9182-BB16E2E075CC@gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
> That's what I was thinking to do, but how do I distinguish between the databases ? The datadir/base seems have directories whose names are numbers.

Use pg_database_size function to get the size of DB.

You can create a plpgsql function, which you can schedule using pgagent 

Or 

If you are writing Bash script capture the return value of pg_database_size function, in some variable and perform vacuum.

Thanks & Regards,
Vibhor Kumar (PCP & OCP)
ITIL V3 Cerftified.

On 05-Apr-2010, at 9:38 AM, Nilesh Govindarajan wrote:

> On 04/05/10 08:54, Scott Marlowe wrote:
>> On Sun, Apr 4, 2010 at 8:21 PM, Nilesh Govindarajan<lists(at)itech7(dot)com>  wrote:
>>> Hi,
>>> 
>>> I wish to execute VACUUM FULL when DB touches a specific size. How to do it
>>> ?
>>> 
>>> I'm aware about the caveats of VACUUM FULL.
>>> 
>> 
>> Write a bash script that cds to the data dir and runs du -s, grabs the
>> value, and if it's over a certain size then run vacuum full.
> 
> 
> 
> -- 
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
> मेरा भारत महान !
> मम भारत: महत्तम भवतु !
> 
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin


In response to

pgsql-admin by date

Next:From: Guillaume LelargeDate: 2010-04-05 06:29:15
Subject: Re: Execute VACUUM FULL when DB touches a specific size ?
Previous:From: Nilesh GovindarajanDate: 2010-04-05 04:08:45
Subject: Re: Execute VACUUM FULL when DB touches a specific size ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group