Re: Transform for pl/perl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Transform for pl/perl
Date
Msg-id 2941.1529347229@sss.pgh.pa.us
Whole thread Raw
In response to Re: Transform for pl/perl  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Responses Re: Transform for pl/perl
List pgsql-hackers
ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes:
> [ 0001-Fix-excess-enreferencing-in-plperl-jsonb-transform.patch ]

I tested this a bit more thoroughly by dint of applying Data::Dumper
to the Perl values, and found that we were still getting extra references
to sub-objects, for example

INFO:  $VAR1 = {'1' => \{'2' => \['3','4','5']},'2' => '3'};

where what we want is

INFO:  $VAR1 = {'1' => {'2' => ['3','4','5']},'2' => '3'};

That turns out to be because the newRV() call in JsonbValue_to_SV()
is also superfluous, if we've set up refs around HV and AV scalars.

Pushed with that change and the extra testing technology.  I'll go
push the dereferencing patch I proposed shortly, as well.

The remaining unresolved issue in this thread is Ilmari's suggestion
that we should convert integers to Perl IV (or UV?) if they fit, rather
than always convert to NV as now.  I'm inclined to reject that proposal,
though, and not just because we don't have a patch for it.  What's
bothering me about it is that then the behavior would be dependent
on the width of IV in the particular Perl installation.  I think that
is a platform dependency we can do without.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Dent John
Date:
Subject: Re: Query Rewrite for Materialized Views (Postgres Extension)
Next
From: Jim Finnerty
Date:
Subject: Re: Query Rewrite for Materialized Views (FDW Extension)