Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5DAE16322CF for ; Wed, 17 Feb 2010 07:36:02 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 58666-05 for ; Wed, 17 Feb 2010 11:35:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moon.antora.ru (moon.antora.ru [89.111.189.180]) by mail.postgresql.org (Postfix) with ESMTP id 8021163280E for ; Wed, 17 Feb 2010 07:35:49 -0400 (AST) Envelope-to: pgsql-sql@postgresql.org Received: from moon.inner.space ([10.1.1.5] helo=moon.antora.ru) by moon.antora.ru with esmtp (Exim 4.67) (envelope-from ) id 1NhiBz-0000zk-ER for pgsql-sql@postgresql.org; Wed, 17 Feb 2010 14:35:43 +0300 Received: from [192.168.1.107] [85.172.37.187] by moon.antora.ru (Axigen) with (DHE-RSA-AES256-SHA encrypted) ESMTPSA id 177E94; Wed, 17 Feb 2010 14:35:43 +0300 Message-ID: <4B7BD441.1080201@bankir.ru> Date: Wed, 17 Feb 2010 14:34:25 +0300 From: silly sad User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20100111 Thunderbird/3.0 MIME-Version: 1.0 CC: pgsql-sql@postgresql.org Subject: Re: very frustrating feature-bug References: <4B7B98AF.9050202@bankir.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.697 tagged_above=-10 required=5 tests=AWL=-0.596, BAYES_50=0.001, MISSING_HEADERS=1.292 X-Spam-Level: X-Archive-Number: 201002/64 X-Sequence-Number: 33663 On 02/17/10 13:51, Jasen Betts wrote: > On 2010-02-17, silly sad wrote: >> >> acc=> >> >> CREATE OR REPLACE FUNCTION add_user (TEXT, TEXT, TEXT, TEXT) >> RETURNS usr AS $$ >> INSERT INTO usr (login,pass,name,email) VALUES ($1,$2,$3,$4) >> RETURNING usr.*; >> $$ LANGUAGE sql SECURITY DEFINER; >> >> acc=> >> >> ERROR: return type mismatch in function declared to return usr >> DETAIL: Function's final statement must be a SELECT. >> CONTEXT: SQL function "add_user" >> >> SURPRISE :-) SURPRISE :-) > > SQL functions are inlined when invoked, and so must be valid subselects. > > rewrite it in plpgsql. thanx for advice. may i ask? when this feature will be fixed? (now i am using 8.3.9)