Re: 8.3: timestamp subtraction

From: Christophe <xof(at)thebuild(dot)com>
To: Pg - General <pgsql-general(at)postgresql(dot)org>
Subject: Re: 8.3: timestamp subtraction
Date: 2009-05-23 13:18:58
Message-ID: 42404B05-34E2-4C75-A74E-FE4D3444BD04@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-05-23 16:09:03 Re: 8.3: timestamp subtraction
Previous Message Daniel Verite 2009-05-23 13:13:18 Re: 8.3: timestamp subtraction