pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Wu <jwu@atlassian.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5974: UNION construct type cast gives poor error message
Date: Wed, 13 Apr 2011 18:02:55 -0500
Message-ID: <4DA5E54F020000250003C7E8@gw.wicourts.gov> (raw)
In-Reply-To: <24771.1302730369@sss.pgh.pa.us>
References: <201104122018.p3CKIlWR042915@wwwmaster.postgresql.org>
	<201104122018.p3CKIlWR042915@wwwmaster.postgresql.org>
	<9799.1302719551@sss.pgh.pa.us>
	<4DA5B8A4020000250003C7A9@gw.wicourts.gov>
	<4DA5B8A4020000250003C7A9@gw.wicourts.gov>
	<11920.1302727156@sss.pgh.pa.us>
	<4DA5CADB020000250003C7BE@gw.wicourts.gov>
	<4DA5CADB020000250003C7BE@gw.wicourts.gov>
	<24771.1302730369@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> wrote:
 
> so far as I can see the spec simply disallows a
> not-explicitly-cast NULL constant in cases like this, which seems
> if anything even less friendly than what we're doing.
 
Just to illustrate the current behavior:
 
test=# select null union select 1;
 ?column?
----------
        1

(2 rows)

test=# select null union select null union select 1;
ERROR:  UNION types text and integer cannot be matched
LINE 1: select null union select null union select 1;
                                                   ^
test=# select null union (select null union select 1);
 ?column?
----------

        1
(2 rows)
 
So, we're talking about making the second of these three cases work,
too.  I'm not sure the spec requires *any* of them to work.
 
-Kevin



view thread (20+ messages)  latest in thread

Message-ID: <4DA5E54F020000250003C7E8@gw.wicourts.gov>
Permalink:  ../4DA5E54F020000250003C7E8@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4DA5E54F020000250003C7E8@gw.wicourts.gov

 · 

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: Kevin.Grittner@wicourts.gov, tgl@sss.pgh.pa.us, jwu@atlassian.com
  Subject: Re: BUG #5974: UNION construct type cast gives poor error message
  In-Reply-To: <4DA5E54F020000250003C7E8@gw.wicourts.gov>
  References: <201104122018.p3CKIlWR042915@wwwmaster.postgresql.org> <9799.1302719551@sss.pgh.pa.us> <4DA5B8A4020000250003C7A9@gw.wicourts.gov> <11920.1302727156@sss.pgh.pa.us> <4DA5CADB020000250003C7BE@gw.wicourts.gov> <24771.1302730369@sss.pgh.pa.us> <4DA5E54F020000250003C7E8@gw.wicourts.gov>

* 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