pl/perl example in the doc no longer works in 9.1
Amit Khandekar <amit.khandekar@enterprisedb.com>
From: Amit Khandekar <amit.khandekar@enterprisedb.com>
To: hackers@postgresql.org
Date: 2011-10-12T09:16:52Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Convert Postgres arrays to Perl arrays on PL/perl input arguments
- 87bb2ade2ce6 9.1.0 cited
Hi,
An example in the PG documentation gives an error:
http://www.postgresql.org/docs/9.1/interactive/plperl-global.html
CREATE OR REPLACE FUNCTION myfuncs() RETURNS void AS $$
$_SHARED{myquote} = sub {
my $arg = shift;
$arg =~ s/(['\\])/\\$1/g;
return "'$arg'";
};
$$ LANGUAGE plperl;
SELECT myfuncs(); /* initializes the function */
ERROR: PL/Perl function must return reference to hash or array
CONTEXT: PL/Perl function "myfuncs"
Not sure if this is now an expected behaviour. Is it? Accordingly, I
can open this in pgsql-bugs or put this issue in pgsql-docs.