pl/perl example in the doc no longer works in 9.1

From: Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
To: hackers(at)postgresql(dot)org
Subject: pl/perl example in the doc no longer works in 9.1
Date: 2011-10-12 09:16:52
Message-ID: CACoZds2D+0h-5euAxfpd9gQmiiW_MW9uv250Woz0=EGO0szScQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2011-10-12 09:45:42 loss of transactions in streaming replication
Previous Message Magnus Hagander 2011-10-12 08:42:36 Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME