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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Date: 2018-05-01 14:37:56
Message-ID: 18856.1525185476@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

I wrote:
> 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.

Nope, buildfarm shows that still doesn't work everywhere.

If we had a transform function that converted SQL float8 directly
to Perl NV, we could use that to produce NVs containing inf/nan.
But that would be a pretty ridiculous amount of test scaffolding
to create to test what, in the end, is two lines of very
straightforward and unlikely-to-break code.

My recommendation is just to drop these test cases. Getting them
to work on all old Perl versions is more trouble than they're worth.

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2018-05-01 15:00:57 Re: pgsql: Indexes with INCLUDE columns and their support in B-tree
Previous Message Peter Eisentraut 2018-05-01 14:33:26 pgsql: Document that subscription tests require hstore