Re: PL/Perl returning multiple rows - Mailing list pgsql-general

From Joe Conway
Subject Re: PL/Perl returning multiple rows
Date
Msg-id 3FB07F7B.3070700@joeconway.com
Whole thread Raw
In response to Re: PL/Perl returning multiple rows  (Christopher Murtagh <christopher.murtagh@mcgill.ca>)
Responses Re: PL/Perl returning multiple rows
List pgsql-general
Christopher Murtagh wrote:
> On Tue, 2003-11-11 at 00:07, Joe Conway wrote:
>>Write a Pl/Perl function that just does the syscall, and call it from
>>PL/pgSQL. Similarly for complex string parsing, etc.
>
>  That would work if I could get the Pl/Perl function to return an array
> or set of results, but this brings me back to the original problem
> (unless I'm missing something obvious).

Sorry, I guess I didn't sufficiently understand the issue. I don't
really use PL/Perl myself, but I would think there was some way to
return an array. In the docs, I see:

"Conversely, the return command will accept any string that is
acceptable input format for the function's declared return type. So, the
PL/Perl programmer can manipulate data values as if they were just text."

So if you declare the PL/Perl function to return text[], and return a
properly formatted array, e.g. something like
   "{\"blah blah\",\"foo bar\",\"etc etc\"}"
it ought to work.

Joe



pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: PL/Perl returning multiple rows
Next
From: Joe Conway
Date:
Subject: Re: PL/Perl returning multiple rows