BUG #2426: perl function that returns setof composite type

From: "Chana Slutzkin" <chana(at)cs(dot)huji(dot)ac(dot)il>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2426: perl function that returns setof composite type
Date: 2006-05-09 07:52:05
Message-ID: 200605090752.k497q59H038494@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2426
Logged by: Chana Slutzkin
Email address: chana(at)cs(dot)huji(dot)ac(dot)il
PostgreSQL version: 8.1.3
Operating system: FreeBSD 6.1
Description: perl function that returns setof composite type
Details:

The code below works fine on version 8.0.3.
However, on version 8.1.3, the last query returns
the following error:

set-valued function called in context that cannot accept a set

Hence there does not seem to be an way to use
a perl function that returns 'setof composite'
on non-constant input.

------------------------------------------------------
DROP TABLE num CASCADE;
CREATE TABLE num (n int);
COPY num FROM stdin;
1
2
3
\.

CREATE OR REPLACE FUNCTION sqlget(num) RETURNS SETOF num AS $$
SELECT $1.n
$$ LANGUAGE SQL;

CREATE OR REPLACE FUNCTION perlget(num) RETURNS SETOF num AS $$
return [{n=>$_[0]->{n}}];
$$ LANGUAGE plperl;

SELECT (sqlget(num.*)).* FROM num;
SELECT (perlget(num.*)).* FROM num;

Browse pgsql-bugs by date

  From Date Subject
Next Message Simon Riggs 2006-05-09 10:53:03 Re: BUG #2419: could not reattach to shared memory
Previous Message Alvaro Herrera 2006-05-08 12:31:20 Re: BUG #2419: could not reattach to shared memory