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 | integername | texttype | textstatus | textiscategory | booleanisport
| boolean
--
Dan Langille : http://www.langille.org/