X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 142B852CF3 for ; Fri, 15 Jul 2005 08:48:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23161-03 for ; Fri, 15 Jul 2005 11:48:46 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 7882D52CEE for ; Fri, 15 Jul 2005 08:48:45 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j6FBmhXC008916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jul 2005 05:48:45 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j6FBmhJ6029700; Fri, 15 Jul 2005 05:48:43 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j6FBmgHW029699; Fri, 15 Jul 2005 05:48:42 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 15 Jul 2005 05:48:42 -0600 From: Michael Fuhr To: Vivek Cc: pgsql-sql@postgresql.org Subject: Re: Yearly Archival System Using PostgreSQL Message-ID: <20050715114842.GA29677@winnie.fuhr.org> References: <1121333057.572963.320670@z14g2000cwz.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1121333057.572963.320670@z14g2000cwz.googlegroups.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/138 X-Sequence-Number: 22116 On Thu, Jul 14, 2005 at 02:24:17AM -0700, Vivek wrote: > I am developing a database system using PostgreSQL in which I should be > able to delete redundant records once a year (Time specified by the > user). THe redundant records should be inserted into the archive table > which is part of the same database. > > Is this possible in pgsql? Can I program a function in SQL or a trigger > to fire when the computer switches on say Jan 1 of every year? This is asked and answered from time to time; search the archives for past discussion. The usual answer is to use your operating system's mechanism for scheduling period jobs, e.g., cron on Unix. -- Michael Fuhr http://www.fuhr.org/~mfuhr/