Skip site navigation (1) Skip section navigation (2)

Re: BUG #1847: Error in some kind of UNION query.

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: THIBAULT Jean-Jacques <jjt4(at)wanadoo(dot)fr>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1847: Error in some kind of UNION query.
Date: 2005-08-25 14:09:12
Message-ID: 20050825140912.GA52581@winnie.fuhr.org (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-bugs by date

Next:From: Andreas PflugDate: 2005-08-25 14:13:23
Subject: Re: BUG #1847: Error in some kind of UNION query.
Previous:From: THIBAULT Jean-JacquesDate: 2005-08-25 08:53:26
Subject: BUG #1847: Error in some kind of UNION query.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group