Unix Technical Forum

BUG #2426: perl function that returns setof composite type

This is a discussion on BUG #2426: perl function that returns setof composite type within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2426 Logged by: Chana Slutzkin Email address: chana@cs.huji.ac.il PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:58 AM
Chana Slutzkin
 
Posts: n/a
Default BUG #2426: perl function that returns setof composite type


The following bug has been logged online:

Bug reference: 2426
Logged by: Chana Slutzkin
Email address: chana@cs.huji.ac.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;

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:43 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com