Re: BUG #15129: Problem with UNION/UNION ALL type setting when several NULL values before defining the proper type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15129: Problem with UNION/UNION ALL type setting when several NULL values before defining the proper type
Дата
Msg-id 31859.1521992600@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15129: Problem with UNION/UNION ALL type setting when several NULL values before defining the proper type  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:
>  PG> While migrating a view from another RDBMS,I reached something that
>  PG> looks lie a bug in postgres.

> It's not a bug in the code, though perhaps you could point out a place
> where the documentation could be improved?

It strikes me that section 10.5 doesn't say explicitly that multiple
UNIONs are resolved pairwise.  Someone who expected "x union y union z"
to be resolved holistically, like a 3-way CASE would be, is not going
to be enlightened by that section.  Perhaps an additional example
using this exact situation would be helpful.

> (The SQL standard is of no particular help here since it does not allow
> NULL to appear "bare", except in contextually typed expressions.)

I think the SQL spec does offer considerable support for our pairwise
resolution approach --- nowhere does it suggest that "x union y union z"
is a construct that should be considered as a whole rather than as a
nest of two independent union operations.

            regards, tom lane


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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15129: Problem with UNION/UNION ALL type setting when several NULL values before defining the proper type
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15130: outer-join-escape syntax seems not to work with latestjdbc-driver