Re: 8.3: timestamp subtraction - Mailing list pgsql-general

From Scott Marlowe
Subject Re: 8.3: timestamp subtraction
Date
Msg-id dcc563d10905230909w6a0a8f0flc6ba1ef45013917a@mail.gmail.com
Whole thread Raw
In response to Re: 8.3: timestamp subtraction  (Christophe <xof@thebuild.com>)
Responses Re: 8.3: timestamp subtraction  (Ludwig Kniprath <ludwig@kni-online.de>)
List pgsql-general
On Sat, May 23, 2009 at 7:18 AM, Christophe <xof@thebuild.com> wrote:
>
> On May 23, 2009, at 9:13 AM, Daniel Verite wrote:
>>>
>>> I don't know why this query returns false:
>>> SELECT '20040506 070809.010000'::timestamp(6) - '20010203
>>> 040506.007000'::timestamp(6) = '1188 day 3 hour 3 minute 3 second 3
>>> millisecond'::interval;
>>> If I just subtract the two timestamps, its result is the interval I
>>> specified.
>>> What may cause this?
>>
>> It works for me:
>>
>> test=> SELECT '20040506 070809.010000'::timestamp(6) -
>> '20010203 040506.007000'::timestamp(6)=
>> '1188 day 3 hour 3 minute 3 second 3 millisecond'::interval;
>> ?column? ----------
>> t
>> (1 row)
>
> Could this be due to the OP's build of PG using floating point timestamps?

That's what I'm thinking.

pgsql-general by date:

Previous
From: Christophe
Date:
Subject: Re: 8.3: timestamp subtraction
Next
From: Ludwig Kniprath
Date:
Subject: Re: 8.3: timestamp subtraction