Peter Neu wrote:
> Thanks. This script looks good. :o)
>
> How do I call it once a day with a cron job on my linux box?
Put the script in a file (e.g. expiry_script.sql) then add to your crontab:
/path/to/psql -U <username> -d <database> -f /path/to/expiry_script.sql -q
See man psql, man 5 crontab for more details.
Oh, you might want to read up on the .pgpass file too - that will give
you a safe place to store your passwords.
--
Richard Huxton
Archonet Ltd