Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3CD6C476117 for ; Thu, 23 May 2002 12:18:20 -0400 (EDT) Received: from wolff.to (wolff.to [66.92.219.49]) by postgresql.org (Postfix) with SMTP id B4A16475BD4 for ; Thu, 23 May 2002 11:20:30 -0400 (EDT) Received: (qmail 23982 invoked by uid 500); 23 May 2002 15:24:22 -0000 Date: Thu, 23 May 2002 10:24:22 -0500 From: Bruno Wolff III To: rhema@bhasin.co.in Cc: pgsql-sql@postgresql.org Subject: Re: Message-ID: <20020523152422.GB23741@wolff.to> Mail-Followup-To: rhema@bhasin.co.in, pgsql-sql@postgresql.org References: <20020523112720.23101.qmail@vmail1.ebhasin.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020523112720.23101.qmail@vmail1.ebhasin.com> User-Agent: Mutt/1.3.25i X-Archive-Number: 200205/258 X-Sequence-Number: 7893 On Thu, May 23, 2002 at 11:27:20 +0000, rhema@bhasin.co.in wrote: > hello, > I need to know if there are any database event triggers > in postgres like i want the trigger to run periodically(every day just like > crontab on unix), i need to delete the records in a table automatically > after a period of say 90 days. > > It is possible to create trigger on table before insert or update but if > there are no insertions or updations on the table, the record will remain > in the database. > looking forward for the suggestions. Probably you just ran to run a cron job that deletes records older than 90 days in order to reclaim space. If it is important that transactions not see this older data, than you want to write your selects so that older records are not visible.