Re: Best way to delete time stamped data?

From: Josh Berkus <josh(at)agliodbs(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 23:19:41
Message-ID: 200305021619.41879.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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 Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-05-02 23:21:29 Re: 'foreign key with default null' problem in allergies
Previous Message Steve Crawford 2003-05-02 22:51:53 Re: Best way to delete time stamped data?

Browse pgsql-sql by date

  From Date Subject
Next Message A.Bhuvaneswaran 2003-05-03 05:13:45 Re: timeofday() and now() issue..
Previous Message Stephan Szabo 2003-05-02 23:11:57 Re: Time formating