pl/perl example in the doc no longer works in 9.1 - Mailing list pgsql-hackers

From Amit Khandekar
Subject pl/perl example in the doc no longer works in 9.1
Date
Msg-id CACoZds2D+0h-5euAxfpd9gQmiiW_MW9uv250Woz0=EGO0szScQ@mail.gmail.com
Whole thread Raw
Responses Re: pl/perl example in the doc no longer works in 9.1
List 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.


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
Next
From: Fujii Masao
Date:
Subject: loss of transactions in streaming replication