automatic verifications

Started by Melanie Bergeronover 22 years ago4 messagesgeneral
Jump to latest
#1Melanie Bergeron
mbergeron_pg@globeecom.com

Hi!

I am new with PostgreSQL and I want to know if this database give the
possibility to verify automatically, each night, if some records are
too old (by example, if session_date is older than a month) and if so
delete them.

Thanks for your help!

Melanie

#2Doug McNaught
doug@mcnaught.org
In reply to: Melanie Bergeron (#1)
Re: automatic verifications

Melanie Bergeron <mbergeron_pg@globeecom.com> writes:

Hi!

I am new with PostgreSQL and I want to know if this database give the
possibility to verify automatically, each night, if some records are
too old (by example, if session_date is older than a month) and if so
delete them.

That's not really something you would build into a server. I'd do it
by writing a maintenance script and having it run by 'cron'. The
script would just do a "DELETE FROM sessions WHERE session_date < ..."

-Doug

#3Bruno Wolff III
bruno@wolff.to
In reply to: Melanie Bergeron (#1)
Re: automatic verifications

On Thu, Dec 18, 2003 at 17:05:30 -0500,
Melanie Bergeron <mbergeron_pg@globeecom.com> wrote:

Hi!

I am new with PostgreSQL and I want to know if this database give the
possibility to verify automatically, each night, if some records are
too old (by example, if session_date is older than a month) and if so
delete them.

The normal way to do that would be to run a daily cron job that deletes
all of the records with session date older than one month.

#4Melanie Bergeron
mbergeron_pg@globeecom.com
In reply to: Bruno Wolff III (#3)
Re: automatic verifications

Thanks for your help

Melanie