Re: Transform for pl/perl

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker ), Alvaro Herrera <alvherre@2ndquadrant.com>, Pavel Stehule <pavel.stehule@gmail.com>, Nikita Glukhov <n.gluhov@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-06-08T21:05:29Z
Lists: pgsql-hackers

Attachments

I wrote:
> I'm inclined to think that auto-dereference is indeed a good idea,
> and am tempted to go make that change to make all this consistent.
> Comments?

Here's a draft patch for that.  I ended up only changing
plperl_sv_to_datum.  There is maybe a case for doing something
similar in plperl_return_next_internal's fn_retistuple code path,
so that you can return a reference-to-reference-to-hash there;
but I was unable to muster much enthusiasm for touching that.

			regards, tom lane

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.