Skip site navigation (1) Skip section navigation (2)

BUG #6645: Getting an error with “ERROR: P?==?utf-8?q?L/Perl function must return reference to hash or array?==?utf-8?b?4oCdPw==

From: me(at)evancarroll(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6645: Getting an error with “ERROR: P?==?utf-8?q?L/Perl function must return reference to hash or array?==?utf-8?b?4oCdPw==
Date: 2012-05-16 16:47:49
Message-ID: E1SUhO9-00074q-53@wrigleys.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      6645
Logged by:          Evna Carroll
Email address:      me(at)evancarroll(dot)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:

=# 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)


Responses

pgsql-bugs by date

Next:From: Alex HunsakerDate: 2012-05-16 17:27:34
Subject: Re: [BUGS] BUG #6645: Getting an error with “ERROR?==?UTF-8?Q?: PL/Perl function must return reference to hash or array”?==?UTF-8?Q??
Previous:From: Andrew DunstanDate: 2012-05-16 14:23:07
Subject: Re: 9.2beta1 regression: pg_restore --data-only does not set sequence values any more

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group