Re: Anyone want to fix plperl for null array elements? - Mailing list pgsql-hackers

From Michael Fuhr
Subject Re: Anyone want to fix plperl for null array elements?
Date
Msg-id 20051118032005.GA69957@winnie.fuhr.org
Whole thread Raw
In response to Anyone want to fix plperl for null array elements?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Anyone want to fix plperl for null array elements?  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Thu, Nov 17, 2005 at 08:41:51PM -0500, Tom Lane wrote:
> I think plperl should be fixed to translate undef to NULL when returning
> an array, but currently it translates to an empty string:

I'll take a look at this if nobody else steps up.  It might just
be a minor change to this part of plperl.c:

210     "    else " \
211     "    { " \
212     "      my $str = qq($elem); " \
213     "      $str =~ s/([\"\\\\])/\\\\$1/g; " \
214     "      $res .= qq(\"$str\"); " \
215     "    } " \

> There might be some problems going in the other direction, too;
> I haven't tried.  Anybody feeling eager to fix this?

Does the current implementation provide automatic conversion to a
Perl array for inbound values?  Unless I'm missing something that
entire problem might still need to be solved.

-- 
Michael Fuhr


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: MERGE vs REPLACE
Next
From: "Andrew Dunstan"
Date:
Subject: Re: Anyone want to fix plperl for null array elements?