pgsql: Allow plperl_sv_to_datum to look through scalar refs. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Allow plperl_sv_to_datum to look through scalar refs.
Date
Msg-id E1fUzsr-0006Fz-9u@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Allow plperl_sv_to_datum to look through scalar refs.

There seems little reason for the policy of throwing error if we
find a ref to something other than a hash or array.   Recursively
look through the ref, instead.  This makes the behavior in non-transform
cases comparable to what was already instantiated for jsonb_plperl.

Note that because we invoke any available transform function before
considering the ref case, it's up to each transform function whether
it wants to play along with this behavior or do something different.

Because the previous behavior was just to throw a useless error,
this seems unlikely to create any compatibility issues.  Still, given
the lack of field complaints so far, seems best not to back-patch.

Discussion: https://postgr.es/m/28336.1528393969@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3a382983d142ca270fe49c63fa6d4a95037ebee3

Modified Files
--------------
src/pl/plperl/expected/plperl.out |  9 ++++++---
src/pl/plperl/plperl.c            | 12 +++++++-----
src/pl/plperl/sql/plperl.sql      |  2 +-
3 files changed, 14 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Avoid platform-dependent output from Data::Dumper.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix contrib/hstore_plperl to look through scalar refs.