Re: Best way to delete time stamped data?

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Kyle <kyle(at)ccidomain(dot)com>, Forum - PostGreSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Best way to delete time stamped data?
Date: 2003-05-02 22:51:53
Message-ID: 20030502225153.9AC1F103C7@polaris.pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2003-05-02 23:19:41 Re: Best way to delete time stamped data?
Previous Message Hadley Willan 2003-05-02 22:46:16 PSQL by itself?

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-05-02 23:11:57 Re: Time formating
Previous Message Stephan Szabo 2003-05-02 22:42:46 Re: How to increase precision?