Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id E954F63233B; Tue, 6 Jan 2009 13:46:10 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 09234-04-2; Tue, 6 Jan 2009 13:46:02 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.236]) by mail.postgresql.org (Postfix) with ESMTP id C8E556322B9; Tue, 6 Jan 2009 13:44:01 -0400 (AST) Received: by rv-out-0506.google.com with SMTP id b25so9255080rvf.43 for ; Tue, 06 Jan 2009 09:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=A0oMOyNe/s8w+22fUzIF9P41Tyasrd0kNL4MxoSC8BU=; b=bz2EyEz6X1AIgmKpMNlwDfitYkdZ3WTkSNt1BjPWCZ0HDlI8YSXGeK0iZ0ShpTtf9A WResfUf3J7/JXHZXNYg1RrNcd6vkTZAfl3K5+zzLFFa0LSJ2r8BtDpn8CmQRU3EH3Ixq HC37J86Rgldgfjig1Joabshd+/nKaCRDuDyiw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=qUPZtQO5fc0r5u5nHyY5sxfE2RYP+5ZKQpxZpNyKOP1Q+kPR1KKcAh5LD6n82Es8jT lueUlaA0UqcEqY/k/t1h3I00+TxCMW40ThmSdoNHhqyxMyoSpWsGaz1uxVU05tb2JVUE np9D6LEBiAVGm1SIV61ZySrw7WMxiYoqsKmnw= Received: by 10.141.89.13 with SMTP id r13mr11043136rvl.76.1231263839583; Tue, 06 Jan 2009 09:43:59 -0800 (PST) Received: by 10.141.98.4 with HTTP; Tue, 6 Jan 2009 09:43:59 -0800 (PST) Message-ID: <65937bea0901060943w52c5473ucee1a90f36842d4c@mail.gmail.com> Date: Tue, 6 Jan 2009 23:13:59 +0530 From: "Gurjeet Singh" To: "Tom Lane" Subject: Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text Cc: "Pavel Stehule" , "PGSQL General" , "PGSQL Hackers" In-Reply-To: <8183.1231249686@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_56878_17175816.1231263839573" References: <65937bea0901052223w162a977dyeaaf888a854f7324@mail.gmail.com> <162867790901052230l25b10f08qa35f56856b9cc4c6@mail.gmail.com> <65937bea0901052237j50657573i8c980f9f5f4814d5@mail.gmail.com> <162867790901052245l4e4fa9b2ydc03781b45b13276@mail.gmail.com> <65937bea0901060104n399cdec8ye5e2b8e247e5139a@mail.gmail.com> <7588.1231246899@sss.pgh.pa.us> <65937bea0901060538n13099005p62f05ef60ed352bd@mail.gmail.com> <8183.1231249686@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200901/93 X-Sequence-Number: 142178 ------=_Part_56878_17175816.1231263839573 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Jan 6, 2009 at 7:18 PM, Tom Lane wrote: > "Gurjeet Singh" writes: > >> This is a horrendously bad idea; it will bite your *ss sooner or later, > >> probably sooner. > > > Can you please let us know how this would be problematic? > > The point is that it's going to have unknown, untested effects on the > default coercion rules, possibly leading to silent changes in the > behavior of queries that used to work. If you'd rather retest every one > of your other queries than fix this one, then go ahead. > > Changing the query is an option not given to us. It is being migrated from a BigDB. I was working on these solutions assuming that these are workarounds to a bug. But from your mails, it seems that it is an expected behaviour; is it? If we consider the second branch of UNION ALL of both the queries above, if "select '' " yields a text column, then so should a "select * from (select '')". Its not exactly a bug, but sure is a problem that we should try to resolve. Thanks and best regards, -- gurjeet[.singh]@EnterpriseDB.com singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com EnterpriseDB http://www.enterprisedb.com Mail sent from my BlackLaptop device ------=_Part_56878_17175816.1231263839573 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Jan 6, 2009 at 7:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Gurjeet Singh" <singh.gurjeet@gmail.com> writes:
>> This is a horrendously bad idea; it will bite your *ss sooner or later,
>> probably sooner.

> Can you please let us know how this would be problematic?

The point is that it's going to have unknown, untested effects on the
default coercion rules, possibly leading to silent changes in the
behavior of queries that used to work.  If you'd rather retest every one
of your other queries than fix this one, then go ahead.


Changing the query is an option not given to us. It is being migrated from a BigDB.

I was working on these solutions assuming that these are workarounds to a bug. But from your mails, it seems that it is an expected behaviour; is it?

If we consider the second branch of UNION ALL of both the queries above, if "select '' " yields a text column, then so should a "select * from (select '')".

Its not exactly a bug, but sure is a problem that we should try to resolve.

Thanks and best regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB      http://www.enterprisedb.com

Mail sent from my BlackLaptop device
------=_Part_56878_17175816.1231263839573--