• Tom Lane's avatar
    Allow plperl_sv_to_datum to look through scalar refs. · 3a382983
    Tom Lane authored
    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
    3a382983
plperl.out 21.7 KB