From: Josh Berkus <josh@agliodbs.com>
To: Kyle <kyle@ccidomain.com>
To: Forum - PostGreSQL SQL <pgsql-sql@postgresql.org>
Subject: Re: Best way to delete time stamped data?
Date: Fri, 2 May 2003 16:19:41 -0700
Message-ID: <200305021619.41879.josh@agliodbs.com> (raw)
In-Reply-To: <3EB2EBF0.8010003@ccidomain.com>
References: <3EB2EBF0.8010003@ccidomain.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, kyle@ccidomain.com
Subject: Re: Best way to delete time stamped data?
In-Reply-To: <200305021619.41879.josh@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox