Re: BUG #1847: Error in some kind of UNION query. - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: BUG #1847: Error in some kind of UNION query.
Date
Msg-id 20050825140912.GA52581@winnie.fuhr.org
Whole thread Raw
In response to BUG #1847: Error in some kind of UNION query.  ("THIBAULT Jean-Jacques" <jjt4@wanadoo.fr>)
List pgsql-bugs
On Thu, Aug 25, 2005 at 09:53:26AM +0100, THIBAULT Jean-Jacques wrote:
>
> this query work :
> select null UNION 1;

Please show the *exact* query.  The above produces a syntax error:

test=> select null UNION 1;
ERROR:  syntax error at or near "1" at character 19
LINE 1: select null UNION 1;
                          ^

I suspect this is the actual query:

test=> select null UNION select 1;
 ?column?
----------
        1

(2 rows)

> this query doesn't work :
> select null UNION null UNION 1;
>
> ERROR:  UNION types text and integer cannot be matched

Again, the query as written causes a syntax error.  This is probably
the actual query:

test=> select null UNION select null UNION select 1;
ERROR:  UNION types text and integer cannot be matched

To understand what's happening, see "UNION, CASE, and ARRAY Type
Resolution" in the "Type Conversion" chapter of the documentation:

http://www.postgresql.org/docs/8.0/static/typeconv-union-case.html

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: "Carlos Chávez"
Date:
Subject: BUG #1845: pg_dump data only COPY wrong order
Next
From: Andreas Pflug
Date:
Subject: Re: BUG #1847: Error in some kind of UNION query.