Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 437EA1F9BE73 for ; Wed, 16 May 2012 13:48:04 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SUhOM-0001F0-T6 for pgsql-bugs@postgresql.org; Wed, 16 May 2012 16:48:03 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SUhO9-0004AM-Ub for pgsql-bugs@postgresql.org; Wed, 16 May 2012 16:47:50 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1SUhO9-00074q-53 for pgsql-bugs@postgresql.org; Wed, 16 May 2012 16:47:49 +0000 Date: Wed, 16 May 2012 16:47:49 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: =?utf-8?q?BUG_=236645=3A_Getting_an_error_with_=E2=80=9CERROR=3A_P?= =?utf-8?q?L/Perl_function_must_return_reference_to_hash_or_array?= =?utf-8?b?4oCdPw==?= To: pgsql-bugs@postgresql.org From: me@evancarroll.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/96 X-Sequence-Number: 33067 The following bug has been logged on the website: Bug reference: 6645 Logged by: Evna Carroll Email address: me@evancarroll.com PostgreSQL version: 9.1.2 Operating system: Linux Description: = This is a cross post from dba.stackexchange.com: http://dba.stackexchange.com/q/17998/2639 The follow code used to work in Postgresql 8.4.11 with perl v5.10.1: =3D# select * From testfunction(); testfunction = ------------------------ http://www.google.com/ However, after doing a dump and load into Postgresql 9.1.3 with perl v5.14.2 I get: ERROR: PL/Perl function must return reference to hash or array CONTEXT: PL/Perl function "testfunction" For reference, here is the function: CREATE OR REPLACE FUNCTION testfunction(OUT text) AS $$ use URI; return URI->new('http://www.google.com/')->canonical; $$ LANGUAGE plperlu; Again, the version of perl changed from v5.10.1 to v5.14.2; however, the return from Data::Peek is the same across both versions: $ perl -MData::Peek -MURI -e'DPeek( URI->new(q[http://www.google.com])->canonical );' Output on both versions of perl: \PVMG("http://www.google.com/"\0)