Re: 8.3: timestamp subtraction

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 8.3: timestamp subtraction
Date: 2009-05-24 11:47:09
Message-ID: gvbc3t$g72$2@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-05-23, Havasvölgyi Ottó <havasvolgyi(dot)otto(at)gmail(dot)com> wrote:
> --0016364c779590a8c0046a9321b6
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> 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?

floating point arithmetic.

especially floats involving fractions.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2009-05-24 13:49:49 Re: do postgresql this job for me ? (firebird user)
Previous Message mnavahan 2009-05-24 09:34:46 Re: do postgresql this job for me ? (firebird user)