diff options
Diffstat (limited to 'src/pl/plperl/plperl.c')
-rw-r--r-- | src/pl/plperl/plperl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index 4342c02b272..4cfc5062531 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -1402,11 +1402,13 @@ plperl_sv_to_datum(SV *sv, Oid typid, int32 typmod, return ret; } - /* Reference, but not reference to hash or array ... */ - ereport(ERROR, - (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("PL/Perl function must return reference to hash or array"))); - return (Datum) 0; /* shut up compiler */ + /* + * If it's a reference to something else, such as a scalar, just + * recursively look through the reference. + */ + return plperl_sv_to_datum(SvRV(sv), typid, typmod, + fcinfo, finfo, typioparam, + isnull); } else { |