Re: UNION result

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: UNION result
Date: 2003-01-15 04:14:01
Message-ID: 200301150414.h0F4E1N01118@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-01-15 04:19:24 Re: UNION result
Previous Message Tatsuo Ishii 2003-01-15 04:03:53 UNION result