X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 07A8D475CEE for ; Fri, 2 May 2003 19:20:09 -0400 (EDT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 56B41475CA9 for ; Fri, 2 May 2003 19:20:08 -0400 (EDT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3004278; Fri, 02 May 2003 16:20:09 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Kyle , Forum - PostGreSQL SQL Subject: Re: Best way to delete time stamped data? Date: Fri, 2 May 2003 16:19:41 -0700 User-Agent: KMail/1.4.3 References: <3EB2EBF0.8010003@ccidomain.com> In-Reply-To: <3EB2EBF0.8010003@ccidomain.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305021619.41879.josh@agliodbs.com> X-Spam-Status: No, hits=-32.4 required=5.0 tests=BAYES_01,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/41 X-Sequence-Number: 13206 Kyle, > DELETE FROM ONLY richtable WHERE trxdate < current_timestamp - interval= =20 > '90 days'; >=20 > This works great. But I was wondering if there is a better or more=20 > compact way to go about it. (this method feels "clunky" to me) More compact than that ?!?!?!=20=20 Maybe you should go into Perl, instead of SQL -- I think the one-liners wou= ld=20 suit you. You can use the age() function, but all that funciton does is the same=20 calculation you have above. --=20 -Josh Berkus Aglio Database Solutions San Francisco