From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>, Steve Crawford <scrawford(at)pinpointresearch(dot)com> |
Cc: | ed despard <despareg(at)clarkson(dot)edu>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: adding times togeather |
Date: | 2003-04-29 11:35:10 |
Message-ID: | 200304291235.10606.dev@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tuesday 29 Apr 2003 12:26 am, Alvaro Herrera Munoz wrote:
> On Mon, Apr 28, 2003 at 02:25:54PM -0800, Steve Crawford wrote:
> > You can:
> > Subtract two times and get an interval
> > Add an interval to a time to get a time
>
> Beware: you cannot (in 7.2.3 at least -- I don't have 7.3 available for
> testing) add a timestamp to an interval and expect a reasonable value.
> You have to add the interval to the timestamp.
>
> h=> select '05:04:03'::interval + '2003-mar-01 09:05:00'::timestamp;
> ?column?
> ---------------------
> 2003-03-01 05:04:03
> (1 row)
In 7.3.2 it just doesn't allow it (undefined operator). Irritating, but better
than the above oddity.
--
Richard Huxton
From | Date | Subject | |
---|---|---|---|
Next Message | Bjorn T Johansen | 2003-04-29 11:42:41 | Importing from Access 2000? |
Previous Message | Shridhar Daithankar | 2003-04-29 09:46:09 | Re: Slow Queries with OR's? |