Re: Bad interval conversion? - Mailing list pgsql-bugs

From Alex Hunsaker
Subject Re: Bad interval conversion?
Date
Msg-id 34d269d40908180904w1c0bd66p45bd5f81830e82e6@mail.gmail.com
Whole thread Raw
In response to Bad interval conversion?  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: Bad interval conversion?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Tue, Aug 18, 2009 at 06:00, hubert depesz
lubaczewski<depesz@depesz.com> wrote:
> Hi,
> tried on latest 8.5, and some 8.3:
> # select '4817191.623 ms'::interval;
>     interval
> ------------------
>  -00:35:47.483648
> (1 row)
>
> I am pretty sure the answer is wrong. But why?

It only happens if you have integer date times on... seems to have
gotten introduced by
http://archives.postgresql.org/pgsql-committers/2008-03/msg00406.php

Im thinking the fact that fsec_t is now an int32 on INT64_TIMESTAMP
builds was a typo/thinko... its really supposed to be int64.

With the attached patch it works correctly and fails with 'out of
range' when its actually out of range.

Attachment

pgsql-bugs by date:

Previous
From: "Morus Walter"
Date:
Subject: BUG #4993: memory issue with array_agg
Next
From: Tom Lane
Date:
Subject: Re: BUG #4993: memory issue with array_agg