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

From Josh Berkus
Subject Re: Best way to delete time stamped data?
Date
Msg-id 200305021619.41879.josh@agliodbs.com
Whole thread Raw
In response to Best way to delete time stamped data?  (Kyle <kyle@ccidomain.com>)
Responses Re: Best way to delete time stamped data?  (Rajesh Kumar Mallah <mallah@trade-india.com>)
List pgsql-sql
Kyle,

> 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)

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.

--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Time formating
Next
From: "A.Bhuvaneswaran"
Date:
Subject: Re: timeofday() and now() issue..