Getting the return type right for SETOF

From: "Dan Langille" <dan(at)langille(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Getting the return type right for SETOF
Date: 2003-08-30 20:42:23
Message-ID: 3F50D3EF.27516.2FEF6552@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi folks,

I'm playing with SETOF on functions. But I can't get the return type
correct. What have I missed? A cast?

CREATE OR REPLACE FUNCTION elementGet (text) RETURNS SETOF
element_type AS '

select 1,
\'test\',
\'F\'
\'A\',
FALSE,
FALSE
'
LANGUAGE sql stable;
ERROR: function declared to return element_type returns "unknown"
instead of text at column 2

\d element_type
Composite type "public.element_type"
Column | Type
------------+---------
id | integer
name | text
type | text
status | text
iscategory | boolean
isport | boolean

--
Dan Langille : http://www.langille.org/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-08-30 20:59:40 Re: Getting the return type right for SETOF
Previous Message Jan Wieck 2003-08-30 02:50:19 Re: BEFORE UPDATE Triggers