Re: Best way to delete time stamped data? - Mailing list pgsql-sql

From Steve Crawford
Subject Re: Best way to delete time stamped data?
Date
Msg-id 20030502225153.9AC1F103C7@polaris.pinpointresearch.com
Whole thread Raw
In response to Best way to delete time stamped data?  (Kyle <kyle@ccidomain.com>)
List pgsql-sql
I'm usually lazy and let automatic casting work for me:
DELETE FROM ONLY richtable WHERE now()-trxdate > '90 days';

Cheers,
Steve

On Friday 02 May 2003 3:06 pm, Kyle wrote:
> Hello.  I have a table that contains time stamped data.  To delete rows
> that are over 90 days old, I do this:
>
>
> DELETE FROM ONLY richtable WHERE trxdate < current_timestamp - interval
> '90 days';
>
>
> This works great.  But I was wondering if there is a better or more
> compact way to go about it.  (this method feels "clunky" to me)
>
> Thanks.
>
> -Kyle
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: How to increase precision?
Next
From: Stephan Szabo
Date:
Subject: Re: Time formating