Re: BUG #5974: UNION construct type cast gives poor error message

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #5974: UNION construct type cast gives poor error message
Дата
Msg-id 4DA5E54F020000250003C7E8@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: BUG #5974: UNION construct type cast gives poor error message  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #5974: UNION construct type cast gives poor error message
Список pgsql-bugs
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> so far as I can see the spec simply disallows a
> not-explicitly-cast NULL constant in cases like this, which seems
> if anything even less friendly than what we're doing.

Just to illustrate the current behavior:

test=# select null union select 1;
 ?column?
----------
        1

(2 rows)

test=# select null union select null union select 1;
ERROR:  UNION types text and integer cannot be matched
LINE 1: select null union select null union select 1;
                                                   ^
test=# select null union (select null union select 1);
 ?column?
----------

        1
(2 rows)

So, we're talking about making the second of these three cases work,
too.  I'm not sure the spec requires *any* of them to work.

-Kevin

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #5974: UNION construct type cast gives poor error message
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5974: UNION construct type cast gives poor error message