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
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to