From: | "Mitch Vincent" <mvincent(at)cablespeed(dot)com> |
---|---|
To: | "Paul Tomblin" <ptomblin(at)xcski(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How should I phrase this? |
Date: | 2001-07-08 18:18:42 |
Message-ID: | 000c01c107da$6d28f430$1251000a@Mitch |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
An alternative, though I'm not sure it's better in any way :
DELETE FROM generators WHERE started + '30 minutes'::interval <= now();
-Mitch
----- Original Message -----
From: "Paul Tomblin" <ptomblin(at)xcski(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Sunday, July 08, 2001 2:12 PM
Subject: [GENERAL] How should I phrase this?
> I've got a table that I insert a value and a timestamp "now()". Then I
> want to delete entries that are older than 30 minutes old. After some
> experimentation, I found the following works, but it looks awkward and
> backwards. Is there a better, more readable way of phrasing this or
> rewriting it?
>
> DELETE
> FROM generators
> WHERE age(now(),started) > interval '30 minutes'
>
>
> --
> Paul Tomblin <ptomblin(at)xcski(dot)com>, not speaking for anybody
> "Nobody can be told what the dominatrix is, they have to see it for
themselves"
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
From | Date | Subject | |
---|---|---|---|
Next Message | Paul Tomblin | 2001-07-08 18:39:46 | Re: How should I phrase this? |
Previous Message | Paul Tomblin | 2001-07-08 18:12:31 | How should I phrase this? |