Re: [BUGS] [HACKERS] Float value 'Infinity' is cast to numeric 1 on Windows

2017-09-27 Thread Tom Lane
Kohei KaiGai writes: > Does it make sense to put a check of "isinf(val)" and ereport prior to > the snprintf()? Yeah, that was my reaction too. Obviously this wasn't thought about in the original coding ... regards, tom lane -- Sent via pgsql-hackers mailing list (pgs

Re: [HACKERS] Float value 'Infinity' is cast to numeric 1 on Windows

2017-09-27 Thread Kohei KaiGai
Hello, Does it make sense to put a check of "isinf(val)" and ereport prior to the snprintf()? It is a lightweight check more than set_var_from_str(). Thanks, 2017-09-27 19:41 GMT+09:00 Taiki Kondo : > Hi all, > > I build PostgreSQL 9.6.5 by Visual Studio 2013 on Windows, I found weird > behavio

[HACKERS] Float value 'Infinity' is cast to numeric 1 on Windows

2017-09-27 Thread Taiki Kondo
Hi all, I build PostgreSQL 9.6.5 by Visual Studio 2013 on Windows, I found weird behavior on it. I execute following SQL, occurring ERROR is expected, but I got mysterious value 1. postgres=# select (float8 'inf')::numeric; numeric - 1 (1 row) On Windows, at least Visual Stu