X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0D171D1B8A3 for ; Sat, 30 Aug 2003 20:41:23 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 62653-01 for ; Sat, 30 Aug 2003 17:41:14 -0300 (ADT) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by svr1.postgresql.org (Postfix) with ESMTP id 138C1D1B524 for ; Sat, 30 Aug 2003 17:41:12 -0300 (ADT) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id BA8D63D28 for ; Sat, 30 Aug 2003 16:41:10 -0400 (EDT) From: "Dan Langille" To: pgsql-sql@postgresql.org Date: Sat, 30 Aug 2003 16:42:23 -0400 MIME-Version: 1.0 Subject: Getting the return type right for SETOF Message-ID: <3F50D3EF.27516.2FEF6552@localhost> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/358 X-Sequence-Number: 14974 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/