pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: will@heroku.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6626: union all with values of type "unknown"
Date: Fri, 04 May 2012 01:01:24 +0000
Message-ID: <E1SQ6tg-0003qf-5P@wrigleys.postgresql.org> (raw)

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=> with hello as (select 'hello' as name)
, bye as (select 'bye' as name)
select * from hello;
 name  
-------
 hello
(1 row)

deik3qfhu265n6=> 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=> 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=> \x
Expanded display is on.
deik3qfhu265n6=> 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




view thread (5+ messages)  latest in thread

Message-ID: <E1SQ6tg-0003qf-5P@wrigleys.postgresql.org>
Permalink:  ../E1SQ6tg-0003qf-5P@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1SQ6tg-0003qf-5P@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: will@heroku.com
  Subject: Re: BUG #6626: union all with values of type "unknown"
  In-Reply-To: <E1SQ6tg-0003qf-5P@wrigleys.postgresql.org>
  References: <E1SQ6tg-0003qf-5P@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox