Re: Transform for pl/perl

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, Nikita Glukhov <n.gluhov@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-04-11T14:38:20Z
Lists: pgsql-hackers
On 4/10/18 07:33, Dagfinn Ilmari Mannsåker wrote:
> 1) both the jsonb_plperl and jsonb_plperlu extensions contain the SQL
>    functions jsonb_to_plperl and plperl_to_jsonb, so can't be installed
>    simultaneously
> 
> 2) jsonb scalar values are passed to the plperl function wrapped in not
>    one, but _two_ layers of references
> 
> 3) jsonb numeric values are passed as perl's NV (floating point) type,
>    losing precision if they're integers that would fit in an IV or UV.
> 
> 4) SV_to_JsonbValue() throws an error for infinite NVs, but not NaNs
> 
> Attached is a patch for the first issue.  I'll look at fixing the rest
> later this week.

Committed #1.  Please keep more patches coming. :)

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Fix jsonb_plperl to convert Perl UV values correctly.

  2. Fix contrib/hstore_plperl to look through scalar refs.

  3. Allow plperl_sv_to_datum to look through scalar refs.

  4. Fix excessive enreferencing in jsonb-to-plperl transform.