Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 269A11C2F16 for ; Thu, 3 May 2012 22:01:38 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SQ6tt-00072D-AJ for pgsql-bugs@postgresql.org; Fri, 04 May 2012 01:01:37 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SQ6tg-0006GC-Gx for pgsql-bugs@postgresql.org; Fri, 04 May 2012 01:01:25 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1SQ6tg-0003qf-5P for pgsql-bugs@postgresql.org; Fri, 04 May 2012 01:01:24 +0000 Date: Fri, 04 May 2012 01:01:24 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6626: union all with values of type "unknown" To: pgsql-bugs@postgresql.org From: will@heroku.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/19 X-Sequence-Number: 32990 The following bug has been logged on the website: Bug reference: 6626 Logged by: Will Leinweber Email address: will@heroku.com PostgreSQL version: 9.1.3 Operating system: ubuntu 10.04 Description: = This was surprising because it worked without the UNION ALL. Casting to text fixes the problem. It seems that this should a column of type unknown. deik3qfhu265n6=3D> with hello as (select 'hello' as name) , bye as (select 'bye' as name) select * from hello; name = ------- hello (1 row) deik3qfhu265n6=3D> with hello as (select 'hello' as name) deik3qfhu265n6-> , bye as (select 'bye' as name) deik3qfhu265n6-> select * from hello UNION ALL select * from bye; ERROR: failed to find conversion function from unknown to text deik3qfhu265n6=3D> with hello as (select 'hello'::text as name) deik3qfhu265n6-> , bye as (select 'bye'::text as name) deik3qfhu265n6-> select * from hello UNION ALL select * from bye; name = ------- hello bye (2 rows) deik3qfhu265n6=3D> \x Expanded display is on. deik3qfhu265n6=3D> select version(); -[ RECORD 1 ]--------------------------------------------------------------------------= --------------------------------- version | PostgreSQL 9.1.3 on x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3, 64-bit