Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2CF946368A4 for ; Fri, 26 Feb 2010 05:45:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 02037-06 for ; Fri, 26 Feb 2010 09:45:34 +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 A5C9563333F for ; Fri, 26 Feb 2010 05:45:34 -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 1NkwlJ-0002wZ-5h for pgsql-sql@postgresql.org; Fri, 26 Feb 2010 12:45:33 +0300 Received: from [192.168.1.107] [85.172.37.247] by moon.antora.ru (Axigen) with (DHE-RSA-AES256-SHA encrypted) ESMTPSA id 0B76FC; Fri, 26 Feb 2010 12:45:32 +0300 Message-ID: <4B879803.5020006@bankir.ru> Date: Fri, 26 Feb 2010 12:44:35 +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 To: pgsql-sql@postgresql.org Subject: Re: what exactly is a query structure? References: <4B876F23.8040401@bankir.ru> In-Reply-To: <4B876F23.8040401@bankir.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scan-Signature: 518c55fec10a74e2156061d7438613ff X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201002/99 X-Sequence-Number: 33698 On 02/26/10 09:50, silly sad wrote: > hello. > > Postgresql 8.3.9 > > CREATE TYPE usr_secrets AS (login TEXT, pass TEXT, shop_pass TEXT); > > CREATE OR REPLACE FUNCTION get_noobs () RETURNS SETOF usr_secrets AS $$ > BEGIN > RETURN QUERY SELECT login, '*' as pass, shop_pass FROM noob; > RETURN; > END; > $$ LANGUAGE plpgsql SECURITY DEFINER; > > SELECT * from get_noobs(); > > And we have the following error > > ERROR: structure of query does not match function result type > my own wild guess: string constant '*' is of type "unknown"