X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4FEA5475EDF for ; Sun, 4 May 2003 09:08:52 -0400 (EDT) Received: from otbnetworks.com (unknown [65.207.140.5]) by postgresql.org (Postfix) with ESMTP id 91874475A45 for ; Sun, 4 May 2003 09:08:51 -0400 (EDT) Received: from ccidomain.com ([10.10.10.2]) (authenticated) by otbnetworks.com (8.11.6/8.11.6) with ESMTP id h44D83924193 for ; Sun, 4 May 2003 09:08:03 -0400 Message-ID: <3EB510F1.8090708@ccidomain.com> Date: Sun, 04 May 2003 09:09:05 -0400 From: Kyle Organization: Creative Connections, Inc. User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Forum - PostGreSQL General Subject: Re: [SQL] Best way to delete time stamped data? References: <3EB2EBF0.8010003@ccidomain.com> <200305021619.41879.josh@agliodbs.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-35.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA 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/81 X-Sequence-Number: 41736 Josh, Thanks, even my boss can read the new statement: DELETE FROM ONLY richtable WHERE age(trxdate) > '90 days'; Your disparaging aside, that is exactly the kind of expression compaction I was after! :) And yeah, I have a deep PERL background, but that's not a bad thing. -Kyle Josh Berkus wrote: > More compact than that ?!?!?! > Maybe you should go into Perl, instead of SQL -- I think the one-liners would > suit you. > > You can use the age() function, but all that funciton does is the same > calculation you have above.