Re: Transform for pl/perl

From: Anthony Bykov <a(dot)bykov(at)postgrespro(dot)ru>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Transform for pl/perl
Date: 2018-02-13 13:43:11
Message-ID: 20180213164311.23af6259@anthony-24-g082ur
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 13 Jan 2018 09:29:46 -0500
Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> wrote:

> There's a bit of an impedance mismatch and inconsistency here. I think
> we need to deal with json scalars (particularly numerics) the same way
> we do for plain scalar arguments. We don't convert a numeric argument
> to and SvNV. We just do this in plperl_call_perl_func():
>
>                 tmp = OutputFunctionCall(&(desc->arg_out_func[i]),
>                                          fcinfo->arg[i]);
>                 sv = cstr2sv(tmp);
>                 pfree(tmp)
> [...]
>
>             PUSHs(sv_2mortal(sv));
>
> Large numerics won't work as SvNV values, which have to fit in a
> standard double. So I think we should treat them the same way we do
> for plain scalar arguments.
>
> (This also suggests that the tests are a bit deficient in not testing
> jsonb with large numeric values.)
>
> I'm going to set this back to waiting on author pending discussion.
>
>
> cheers
>
> andrew
>

Hello,
thank you for your attention.

I'm sorry, but I couldn't understand what types of numerics you was
talking about. Large numerics are just transformed into "inf" (or
"Inf") and the patch contains such test. But there were no tests with
numerics close to "inf" but not "inf" yet. So, I've added such test.

Also I've fixed the thing Thomas Munro was talking about.

--
Anthony Bykov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
0001-jsonb_plperl-extension-v7.patch text/x-patch 62.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-02-13 14:08:55 Re: reorganizing partitioning code (was: Re: [HACKERS] path toward faster partition pruning)
Previous Message Alvaro Herrera 2018-02-13 13:23:19 Re: reorganizing partitioning code (was: Re: [HACKERS] path toward faster partition pruning)