Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5BC6D632C98 for ; Fri, 26 Feb 2010 11:12:09 -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 20653-08 for ; Fri, 26 Feb 2010 15:11:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5FC3C6324F5 for ; Fri, 26 Feb 2010 11:11:58 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o1QFBuQL027167; Fri, 26 Feb 2010 10:11:56 -0500 (EST) To: "A. Kretschmer" cc: pgsql-sql@postgresql.org Subject: Re: what exactly is a query structure? In-reply-to: <20100226095358.GG11413@a-kretschmer.de> References: <4B876F23.8040401@bankir.ru> <4B879803.5020006@bankir.ru> <20100226095358.GG11413@a-kretschmer.de> Comments: In-reply-to "A. Kretschmer" message dated "Fri, 26 Feb 2010 10:53:58 +0100" Date: Fri, 26 Feb 2010 10:11:56 -0500 Message-ID: <27166.1267197116@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.258 tagged_above=-10 required=5 tests=AWL=-1.073, BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201002/101 X-Sequence-Number: 33700 "A. Kretschmer" writes: > In response to silly sad : >> my own wild guess: >> string constant '*' is of type "unknown" > Maybe. Add a explicit cast, for instance '*'::text Definitely. More recent versions of PG provide a more explicit error message: regression=# SELECT * from get_noobs(); ERROR: structure of query does not match function result type DETAIL: Returned type unknown does not match expected type text in column "pass". CONTEXT: PL/pgSQL function "get_noobs" line 2 at RETURN QUERY regards, tom lane