Re: UNION result - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: UNION result
Date
Msg-id 200301150414.h0F4E1N01118@candle.pha.pa.us
Whole thread Raw
In response to UNION result  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
I think the cause is that multi-type UNION queries use the first query
for casting the other parts of the UNION.  In the old days we would just
reject the query because the UNION columns are of different types.

---------------------------------------------------------------------------

Tatsuo Ishii wrote:
> Does anybody know:
> 
> select 1.0 union select 1;
> or
> select 1 union select 1.0;
> 
> should return 1 or 1.0?
> 
> I see below on my Linux box:
> 
> test=# select 1 union select 1.0;
>  ?column? 
> ----------
>         1
> (1 row)
> 
> test=# select 1.0 union select 1;
>  ?column? 
> ----------
>       1.0
> (1 row)
> 
> This seems a little bit inconsistent...
> --
> Tatsuo Ishii
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: UNION result
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: UNION result