Re: [HACKERS] NaN support in NUMERIC data type

2009-04-09 Thread Sam Mason
On Wed, Apr 08, 2009 at 08:16:52PM -0400, Tom Lane wrote: > Sam Mason writes: > > On Wed, Apr 08, 2009 at 06:11:59PM -0400, Tom Lane wrote: > >> Anyway, I revised this a bit and applied to HEAD. > > > I've not tested; but your changes look as though they will break: > > SELECT 'Infinity'::float

Re: [HACKERS] NaN support in NUMERIC data type

2009-04-08 Thread Tom Lane
Sam Mason writes: > On Wed, Apr 08, 2009 at 06:11:59PM -0400, Tom Lane wrote: >> Anyway, I revised this a bit and applied to HEAD. > I've not tested; but your changes look as though they will break: > SELECT 'Infinity'::float::numeric; That gives an error now, just as it did before, so I'm not

Re: [HACKERS] NaN support in NUMERIC data type

2009-04-08 Thread Sam Mason
On Wed, Apr 08, 2009 at 06:11:59PM -0400, Tom Lane wrote: > Sam Mason writes: > > On Tue, Apr 07, 2009 at 12:51:21PM -0400, Tom Lane wrote: > >> IIRC, the explicit support for leading/trailing spaces is something that > >> we added in float8in long after numeric_in was written, and I think just >

Re: [HACKERS] NaN support in NUMERIC data type

2009-04-08 Thread Tom Lane
Sam Mason writes: > On Tue, Apr 07, 2009 at 12:51:21PM -0400, Tom Lane wrote: >> IIRC, the explicit support for leading/trailing spaces is something that >> we added in float8in long after numeric_in was written, and I think just >> nobody thought about numeric at the time. But it's clearly incon

Re: [HACKERS] NaN support in NUMERIC data type

2009-04-08 Thread Sam Mason
On Tue, Apr 07, 2009 at 12:51:21PM -0400, Tom Lane wrote: > Sam Mason writes: > > SELECT 'NaN'::float8; > > SELECT ' NaN'::float8; > > SELECT 'NaN '::float8; > > SELECT '+NaN'::float8; > > SELECT '-NaN'::float8; > > Well, the +- part must be an artifact of your strtod() implementation;

Re: [HACKERS] NaN support in NUMERIC data type

2009-04-07 Thread Tom Lane
Sam Mason writes: > I've just noticed that the NUMERIC input function special cases NaN > values differently to the floating point input functions. For example > the following are all accepted (on my system anyway): > SELECT 'NaN'::float8; > SELECT ' NaN'::float8; > SELECT 'NaN '::float8;

[HACKERS] NaN support in NUMERIC data type

2009-04-07 Thread Sam Mason
Hi, I've just noticed that the NUMERIC input function special cases NaN values differently to the floating point input functions. For example the following are all accepted (on my system anyway): SELECT 'NaN'::float8; SELECT ' NaN'::float8; SELECT 'NaN '::float8; SELECT '+NaN'::float8;