Better error message for select_common_type()

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Better error message for select_common_type()
Дата
Msg-id 200704232255.27273.peter_e@gmx.net
обсуждение исходный текст
Ответы Re: Better error message for select_common_type()  (Gregory Stark <stark@enterprisedb.com>)
Re: Better error message for select_common_type()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Better error message for select_common_type()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Better error message for select_common_type()  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
So I was informed today that UNION types integer and text cannot be 
matched.  Alright, but it failed to tell which particular expressions 
in this 3-branch, 30-columns-each UNION clause in a 100-line statement 
it was talking about.  So I made the attached patch to give some better 
pointers.  Example:

peter=# values(0,1), (1::bigint,2), ('text'::text,3);
ERROR:  42804: VALUES types bigint at position 2 and text at position 3 
cannot be matched in instance 1

I'm not sure about the terminology "position" and "instance"; they're 
just two coordinates to get at the problem.

None of this will help if you have multiple unrelated clauses that 
invoke select_common_type(), but that might be better handled using the 
parser location mechanism.

Comments?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: Improving deadlock error messages
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Better error message for select_common_type()