Re: Transform for pl/perl

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>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Transform for pl/perl
Date: 2018-04-29 18:28:03
Message-ID: 10510.1525026483@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> On 4/24/18 14:31, Andrew Dunstan wrote:
>> There is the routine IsValidJsonNumber that helps - see among others
>> hstore_io.c for an example use.

> I would need something like that taking a double/float8 input. But I
> think there is no such shortcut available, so I just wrote out the tests
> for isinf and isnan explicitly. Attached patch should fix it.
> jsonb_plpython will need a similar fix.

I looked this over, it looks fine to me. I first questioned the use
of ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE for rejecting NaN, but I see
that we are doing that in lots of comparable places (e.g., dtoi4())
so I'm on board with it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-04-29 19:24:40 Re: power() function in Windows: "value out of range: underflow"
Previous Message Joe Wildish 2018-04-29 18:18:00 Re: Implementing SQL ASSERTION