Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D475862E0FE; Tue, 6 Jan 2009 02:37:56 -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 79818-02; Tue, 6 Jan 2009 02:37:53 -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.229]) by mail.postgresql.org (Postfix) with ESMTP id 0182A62DBC5; Tue, 6 Jan 2009 02:37:52 -0400 (AST) Received: by rv-out-0506.google.com with SMTP id b25so9014746rvf.43 for ; Mon, 05 Jan 2009 22:37:51 -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=hsy2bgPmPT+Y9YkVwqqDvf/oFszGVeoKwv/rxo1Z4UE=; b=Pbhpaw0OIeAibUw8H42b4jnrT+EYNW5F7wLz6YbYWNNsQu+6MMnoHeVLd9tQDrJ2cq 8GYtH2iinqDSILgMp1AgFsMvKZWuSSnudROEvsN1Yu1sjT5smqn4GxoNsdHa0oB9Ze/F Wv+85WCDFyj8G00iF6IybCuo4G9FM69d4/YCI= 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=ZZjVoJbD/Cdg9ZGZ7VNHDUSUSkfPxheDqWyi5aer8gG9U1h8yeVYe40rro0QzPV239 4j2WOs152gQEwKuU6nEEmnWcD3HOLTEw9cYrX5MRhEiEOlkNR50nnUS9sieIM9Xgtz1C G5NwHLtz6Aa0n8TKYcaVyhSYznzYhSkAmF5LQ= Received: by 10.140.161.11 with SMTP id j11mr10778094rve.247.1231223871762; Mon, 05 Jan 2009 22:37:51 -0800 (PST) Received: by 10.141.98.4 with HTTP; Mon, 5 Jan 2009 22:37:51 -0800 (PST) Message-ID: <65937bea0901052237j50657573i8c980f9f5f4814d5@mail.gmail.com> Date: Tue, 6 Jan 2009 12:07:51 +0530 From: "Gurjeet Singh" To: "Pavel Stehule" Subject: Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text Cc: "PGSQL General" , "PGSQL Hackers" In-Reply-To: <162867790901052230l25b10f08qa35f56856b9cc4c6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_49790_32664644.1231223871755" References: <65937bea0901052223w162a977dyeaaf888a854f7324@mail.gmail.com> <162867790901052230l25b10f08qa35f56856b9cc4c6@mail.gmail.com> 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/68 X-Sequence-Number: 142153 ------=_Part_49790_32664644.1231223871755 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline As I mentioned, we cannot change the query, so adding casts to the query is not an option. I was looking for something external to the query, like a CREATE CAST command that'd resolve the issue. Best regards, On Tue, Jan 6, 2009 at 12:00 PM, Pavel Stehule wrote: > Hello > > 2009/1/6 Gurjeet Singh : > > Q1: select '' union all select '' > > Q2: select '' union all select * from (select '' ) as s > > > > version: PostgreSQL 8.3.1, compiled by Visual C++ build 1400 > > > > Hi All, > > > > Q1 works just fine, but Q2 fails with: > > > > ERROR: failed to find conversion function from "unknown" to text > > > > Q2 is a generalization of a huge query we are facing, which we cannot > > modify. I don't think this is a 'removed-casts' problem generally faced > in > > 8.3, but I may be wrong. Will adding some cast resolve this? > > yes > > postgres=# select '' union all select * from (select ''::text ) as s; > ?column? > ---------- > > > (2 rows) > > regards > Pavel Stehule > > > > > Best regards, > > -- > > gurjeet[.singh]@EnterpriseDB.com > > singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com > > > > EnterpriseDB http://www.enterprisedb.com > > > > Mail sent from my BlackLaptop device > > > -- gurjeet[.singh]@EnterpriseDB.com singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com EnterpriseDB http://www.enterprisedb.com Mail sent from my BlackLaptop device ------=_Part_49790_32664644.1231223871755 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline As I mentioned, we cannot change the query, so adding casts to the query is not an option. I was looking for something external to the query, like a CREATE CAST command that'd resolve the issue.

Best regards,

On Tue, Jan 6, 2009 at 12:00 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

2009/1/6 Gurjeet Singh <singh.gurjeet@gmail.com>:
> Q1: select '' union all select ''
> Q2: select '' union all select * from (select '' ) as s
>
> version: PostgreSQL 8.3.1, compiled by Visual C++ build 1400
>
> Hi All,
>
>     Q1 works just fine, but Q2 fails with:
>
> ERROR:  failed to find conversion function from "unknown" to text
>
>     Q2 is a generalization of a huge query we are facing, which we cannot
> modify. I don't think this is a 'removed-casts' problem generally faced in
> 8.3, but I may be wrong. Will adding some cast resolve this?

yes

postgres=#  select '' union all select * from (select ''::text ) as s;
 ?column?
----------


(2 rows)

regards
Pavel Stehule

>
> Best regards,
> --
> gurjeet[.singh]@EnterpriseDB.com
> singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com
>
> EnterpriseDB      http://www.enterprisedb.com
>
> Mail sent from my BlackLaptop device
>



--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB      http://www.enterprisedb.com

Mail sent from my BlackLaptop device
------=_Part_49790_32664644.1231223871755--