pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow plperl_sv_to_datum to look through scalar refs.
Date: Mon, 18 Jun 2018 19:32:13 +0000
Message-ID: <E1fUzsr-0006Fz-9u@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1fUzsr-0006Fz-9u@gemulon.postgresql.org>
Permalink:  ../E1fUzsr-0006Fz-9u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fUzsr-0006Fz-9u@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Allow plperl_sv_to_datum to look through scalar refs.
  In-Reply-To: <E1fUzsr-0006Fz-9u@gemulon.postgresql.org>
  References: <E1fUzsr-0006Fz-9u@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox