Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 648C91337B2F for ; Tue, 21 Dec 2010 10:42:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 43558-02 for ; Tue, 21 Dec 2010 14:42:47 +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 4FDF61337990 for ; Tue, 21 Dec 2010 10:42:47 -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 oBLEghq4000305; Tue, 21 Dec 2010 09:42:43 -0500 (EST) To: "Sandro Santilli" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5799: failed to find conversion function from unknown to text In-reply-to: <201012211008.oBLA8evP038251@wwwmaster.postgresql.org> References: <201012211008.oBLA8evP038251@wwwmaster.postgresql.org> Comments: In-reply-to "Sandro Santilli" message dated "Tue, 21 Dec 2010 10:08:40 +0000" Date: Tue, 21 Dec 2010 09:42:43 -0500 Message-ID: <304.1292942563@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/156 X-Sequence-Number: 28962 "Sandro Santilli" writes: > SELECT a, b, ST_RelateMatch(a,b) FROM > ( SELECT '101202FFF' as a, 'TTTTTTFFF' as b) as f; > Results in: > ERROR: failed to find conversion function from unknown to text Cast those unknown literals to text explicitly, ie SELECT a, b, ST_RelateMatch(a,b) FROM ( SELECT '101202FFF'::text as a, 'TTTTTTFFF'::text as b) as f; We don't support doing it the other way because retroactively deciding at the top level that the sub-select's outputs should have been text might change the semantics of the sub-select (consider cases involving DISTINCT for example). regards, tom lane