Re: Temporary Table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-11-08 at 10:22 +0000, Christian Paul B. Cosinas wrote:
> I see.
> 
> But How Can I put this in the Cron of my Linux Server?
> I really don't have an idea :)
> What I want to do is to loop around all the databases in my server and
> execute the vacuum of these 3 tables in each tables.

I usually write a small shell script something like:

==================================================
#!/bin/sh

psql somedatabase <<EOQ
  VACUUM this;
  VACUUM that;
  DELETE FROM someotherplace WHERE delete_this_record;
EOQ
==================================================

and so forth...

This makes the SQL quite nicely readable.


Regards,
					Andrew McMillan.

-------------------------------------------------------------------------
Andrew @ Catalyst .Net .NZ  Ltd,  PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/            PHYS: Level 2, 150-154 Willis St
DDI: +64(4)803-2201      MOB: +64(272)DEBIAN      OFFICE: +64(4)499-2267
            You work very hard.  Don't try to think as well.
-------------------------------------------------------------------------

Attachment: signature.asc
Description: This is a digitally signed message part


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux