Re: [HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-06-01 Thread Tom Lane
Robert Haas writes: > More to the point, it's also what 8.3.7 does: Well, no, because the cases at issue are where an is specified. 8.3 did this: regression=# select '99 seconds'::interval second; interval -- 00:00:39 (1 row) and even more amusingly, regression=# select interval '

Re: [HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-06-01 Thread Robert Haas
On Mon, Jun 1, 2009 at 8:04 PM, Tom Lane wrote: > I wrote: >> Sam Mason writes: >>> On Sun, May 31, 2009 at 06:32:53PM -0400, Tom Lane wrote: There is some case to be made that we should throw error here, which we could do by putting error tests where the attached patch has comment

Re: [HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-06-01 Thread Tom Lane
I wrote: > Sam Mason writes: >> On Sun, May 31, 2009 at 06:32:53PM -0400, Tom Lane wrote: >>> There is some case to be made that we should throw error here, >>> which we could do by putting error tests where the attached patch >>> has comments suggesting an error test. >> With things as they are

Re: [HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-06-01 Thread Tom Lane
Sam Mason writes: > On Sun, May 31, 2009 at 06:32:53PM -0400, Tom Lane wrote: >> There is some case to be made that we should throw error here, >> which we could do by putting error tests where the attached patch >> has comments suggesting an error test. > With things as they are I think it would

Re: [HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-06-01 Thread Sam Mason
On Sun, May 31, 2009 at 06:32:53PM -0400, Tom Lane wrote: > regression=# select '999'::interval second; > The correct interpretation of the input value is certainly 999 seconds. Agreed; silent truncation like this is confusing and will lead to unnecessary bugs in users' code. > the attached patch

[HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-05-31 Thread Tom Lane
As I mentioned a bit ago http://archives.postgresql.org/pgsql-hackers/2009-05/msg01505.php there seems to be a definite problem still remaining with our handling of interval literals. To wit, this behavior is absolutely not per spec: regression=# select '999'::interval second; interval