From: Dan Langille <dan@langille.org>
To: pgsql-sql@postgresql.org
Subject: Getting the return type right for SETOF
Date: Sat, 30 Aug 2003 16:42:23 -0400
Message-ID: <3F50D3EF.27516.2FEF6552@localhost> (raw)
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dan@langille.org
Subject: Re: Getting the return type right for SETOF
In-Reply-To: <3F50D3EF.27516.2FEF6552@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox