Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 86C399F950E for ; Tue, 21 Aug 2007 20:53:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85103-09 for ; Tue, 21 Aug 2007 20:53:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [87.127.95.196]) by postgresql.org (Postfix) with ESMTP id 890D59F950C for ; Tue, 21 Aug 2007 20:53:31 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1INdXG-0001Bb-6Z; Wed, 22 Aug 2007 00:53:22 +0100 To: "Michael Glaesemann" Cc: "Richard Broersma Jr" , "SQL Postgresql List" Subject: Re: SELECT syntax synopsis: column_definition? In-Reply-To: <50700110-2B0D-4935-B033-084ED908BEC5@seespotcode.net> (Michael Glaesemann's message of "Tue\, 21 Aug 2007 18\:04\:56 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.sql" 875) References: <830878.14424.qm@web31803.mail.mud.yahoo.com> <50700110-2B0D-4935-B033-084ED908BEC5@seespotcode.net> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 22 Aug 2007 00:53:21 +0100 Message-ID: <87zm0kigwe.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/183 X-Sequence-Number: 29121 "Michael Glaesemann" writes: > ERROR: a column definition list is only allowed for functions returning > "record" > > So the *form* is right, but I don't know of an example that works. postgres=# create function testf() returns record as 'select 1' language sql; CREATE FUNCTION postgres=# select * from testf() as (i integer); i --- 1 (1 row) I haven't quite figured out how this is useful though. It probably makes more sense if you use plpgsql but I still don't quite see what the use case is. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com