Re: pl/perl example in the doc no longer works in 9.1
От
Tom Lane
Тема
Re: pl/perl example in the doc no longer works in 9.1
Дата
Msg-id
14745.1318436129@sss.pgh.pa.us
Ответ на
Re: pl/perl example in the doc no longer works in 9.1 (David E. Wheeler)
Список
Дерево обсуждения
pl/perl example in the doc no longer works in 9.1 Amit Khandekar <amit.khandekar@enterprisedb.com>
Re: pl/perl example in the doc no longer works in 9.1 "David E. Wheeler" <david@kineticode.com>
Re: pl/perl example in the doc no longer works in 9.1 Tom Lane <tgl@sss.pgh.pa.us>
Re: pl/perl example in the doc no longer works in 9.1 "David E. Wheeler" <david@kineticode.com>
Re: pl/perl example in the doc no longer works in 9.1 Tom Lane <tgl@sss.pgh.pa.us>
Re: pl/perl example in the doc no longer works in 9.1 Alex Hunsaker <badalex@gmail.com>
Re: pl/perl example in the doc no longer works in 9.1 Alex Hunsaker <badalex@gmail.com>
Re: pl/perl example in the doc no longer works in 9.1 Tom Lane <tgl@sss.pgh.pa.us>
Re: pl/perl example in the doc no longer works in 9.1 Alex Hunsaker <badalex@gmail.com>
Re: pl/perl example in the doc no longer works in 9.1 Tom Lane <tgl@sss.pgh.pa.us>
Re: pl/perl example in the doc no longer works in 9.1 Alexey Klyukin <alexk@commandprompt.com>
Re: pl/perl example in the doc no longer works in 9.1 "David E. Wheeler" <david@kineticode.com>
Re: pl/perl example in the doc no longer works in 9.1 Tom Lane <tgl@sss.pgh.pa.us>
Re: pl/perl example in the doc no longer works in 9.1 "David E. Wheeler" <david@kineticode.com>
Re: pl/perl example in the doc no longer works in 9.1 Alexey Klyukin <alexk@commandprompt.com>
"David E. Wheeler" writes:
> On Oct 12, 2011, at 2:16 AM, Amit Khandekar wrote:
>> 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.
> Seems like there should be a bar return at the end of the function, otherwise it returns the last expression, which happens to be a code reference. Not very useful in a function that should return VOID. New version:
Well, the real question is why a function declared to return VOID cares
at all about what the last command in its body is. If this has changed
since previous versions then I think it's a bug and we should fix it,
not just change the example.
regards, tom lane
В списке pgsql-hackers по дате отправления
От: David E. Wheeler
Дата: