Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Дата
в 02:37:18
Msg-id
28585.1525131438@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
pgsql: Prevent infinity and NaN in jsonb/plperl transform Peter Eisentraut <peter_e@gmx.net>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform Tom Lane <tgl@sss.pgh.pa.us>
Andrew Dunstan  writes:
> Fingers crossed we'll be OK. Looking at the perl headers on a Windows
> machine I'm doing some other stuff on, the #define is protected by an
> #ifndef. I'm always happy when my hacks can be removed :-)

Well, the early returns on that are promising, but we have another
problem: prairiedog, jacana, and probably other old BF members are
failing the new regression test cases.  It appears that what the test
script assumes will produce a NaN or Inf float doesn't work in 5.8.x
perl:

$ perl -e "print 0 + 'NaN'"
0
$ perl -e "print 0 + 'Inf'"
0

I googled a bit and found these recommendations on stackoverflow:

my $inf    = 9**9**9;
my $neginf = -9**9**9;
my $nan    = -sin(9**9**9);

These do seem to produce the desired results, at least on the
couple of Perl versions I checked, including 5.8.3.

			regards, tom lane

В списке pgsql-committers по дате отправления
От: Tom Lane
Дата:
От: Tom Lane
Дата:
FAQ