pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tommi.korhonen@thl.fi
To: pgsql-bugs@postgresql.org
Subject: BUG #8513: Error recognizing data type in union
Date: Wed, 09 Oct 2013 12:39:58 +0000
Message-ID: <E1VTt3W-000456-Ca@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8513
Logged by:          Tommi Korhonen
Email address:      tommi.korhonen@thl.fi
PostgreSQL version: 8.4.17
Operating system:   Redhat Linux
Description:        

Example:


create table t1(a integer);
create table t2(b integer);
create table t3(c integer);


select null from t1
union all
select null from t2
union all
select c from t3;


produces an error


ERROR:  UNION types text and integer cannot be matched
LINE 5: select c from t3;


but 


select null from t2
union all
select c from t3;


works correctly.


So it seems that if there are more than one nulls before field c in union
PostreSQL thinks merged field's data type is text.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



Message-ID: <E1VTt3W-000456-Ca@wrigleys.postgresql.org>
Permalink:  ../E1VTt3W-000456-Ca@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1VTt3W-000456-Ca@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: tommi.korhonen@thl.fi
  Subject: Re: BUG #8513: Error recognizing data type in union
  In-Reply-To: <E1VTt3W-000456-Ca@wrigleys.postgresql.org>
  References: <E1VTt3W-000456-Ca@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