Re: Mention column name in error messages

Поиск
Список
Период
Сортировка
От Franck Verrot
Тема Re: Mention column name in error messages
Дата
Msg-id CANfkH5=8OjF4k9VPXjzOeyeM70TN69PjvW7eSy6CAgJX5a9n0Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Mention column name in error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Mention column name in error messages
Список pgsql-hackers


On Sat, Nov 5, 2016 at 11:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
The cases that are successfully annotated by the current patch seem to
mostly already have error cursor information, which really is good enough
IMO --- you can certainly figure out which column corresponds to the
textual spot that the cursor is pointing at.  


The original intent of that patch tried to cover the case where we insert records
made of dozens columns sharing the same type definition, and trying to understand
what is going on, at a glance, when we debugged something like this:


    # create table probes (
        id int,
        pin_1 varchar(2),
        pin_2 varchar(2),
        ...
        pin_19 varchar(2),
        pin_20 varchar(2));
    CREATE TABLE
    
    # insert into probes (
        pin_1,
        pin_2,
        ...
        pin_19,
        pin_20)
      values ( <only valid values> );
    INSERT 0 1
    
    # insert into probes (
        pin_1,
        pin_2,
        ...
        pin_19,
        pin_20)
      values ( <values, some subjects to type casting errors> );
    ERROR:  value too long for type character varying(2)


Relying on the cursor seems to be of little help I'm afraid.


Thanks for having looked into that, very useful to try understanding all
the mechanisms that are involved to make that happen.

Franck

-- 
Franck Verrot

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Add support for SRF and returning composites to pl/tcl
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Mention column name in error messages