Re: [HACKERS] Error in parser with UNIONS.

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] Error in parser with UNIONS.
Дата
Msg-id 35659C06.85048A4D@alumni.caltech.edu
обсуждение исходный текст
Ответ на Error in parser with UNIONS.  (Chris Albertson <chris@topdog.pas1.logicon.com>)
Ответы Re: [HACKERS] Error in parser with UNIONS.  (dg@illustra.com (David Gould))
Список pgsql-hackers
Made some progress:

postgres=> select 1.2 as float8 union select 1;
float8
------
     1
   1.2
(2 rows)

postgres=> select text 'a' as text union select 'b';
text
----
a
b
(2 rows)

At the moment I'm forcing the types of the union to match the types of
the first/top clause in the union:

postgres=> select 1 as all_integers
postgres-> union select '2.2'::float4 union select 3.3;
all_integers
------------
           1
           2
           3
(3 rows)

The better strategy might be to choose the "best" type of the bunch, but
is more difficult because of the nice recursion technique used in the
parser. However, it does work OK when selecting _into_ a table:

postgres=> create table ff (f float);
CREATE
postgres=> insert into ff
postgres-> select 1 union select '2.2'::float4 union select 3.3;
INSERT 0 3
postgres=> select * from ff;
               f
----------------
               1
2.20000004768372
             3.3
(3 rows)

Comments??

                     - Tom

В списке pgsql-hackers по дате отправления:

Предыдущее
От: t-ishii@sra.co.jp (Tatsuo Ishii)
Дата:
Сообщение: Re: [HACKERS] Current sources?
Следующее
От: serj
Дата:
Сообщение: destroydb fail in pgsql CVS from 22.5.98