Reported type mismatch improperly

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Reported type mismatch improperly
Дата
Msg-id CAKU4AWqLX3PDrTdhDabQ3o1Eogf1pCEznbUt6QYyEqmK3rHdsA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Reported type mismatch improperly  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
Currently when we call select_common_type, it compares the 2 exprs, if the expr
type of both are unknown, it will be set to TEXTOID with some reasons, which
can cause the issue like below.


postgres=# select null union all select null union all select 1;
ERROR:  UNION types text and integer cannot be matched
LINE 1: select null union all select null union all select 1;


In this case, we can't blame the user,  they may want the nulls to be at the top
of the result. 

I worked on a patch to fix this, the main idea is before going to the above
logic, I peak all the exprs for a given column first, and choose a default one
when we see the Unknown & Unknown case(rather than TextOid),  

do you think it is ok?

--
Best Regards
Andy Fan
Вложения

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

Предыдущее
От: "Thiede, Christoph"
Дата:
Сообщение: AW: Stored columns: Unexpected varattno in expression to be mapped
Следующее
От: Jelte Fennema
Дата:
Сообщение: psql has some accessibility issues on Windows