Re: Add column name to error message?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add column name to error message?
Дата
Msg-id 27168.1395175494@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add column name to error message?  (Edson Richter <edsonrichter@hotmail.com>)
Ответы Re: Add column name to error message?  (Edson Richter <edsonrichter@hotmail.com>)
Список pgsql-general
Edson Richter <edsonrichter@hotmail.com> writes:
> Em 18/03/2014 17:17, Francisco Olarte escreveu:
>> Maybe they are not hiding it, but the error is raised by a value
>> checking routine which does not know where the value comes from / goes
>> to ( ie, it's a 'check_varchar(xx, maxlen), which is used to check
>> columns, function aprameters, type casts....) ( that happens to me in
>> my own code in some places where the context / error message is
>> extremely difficult to propagate down / up  ) .

> Thanks, Francisco. I don't know internals.
> But, doesn't the "value checking routing" caller's know which column is
> being tested?

No.  Typically all it would know is that it's evaluating a targetlist; the
fact that the resulting tuple is going to be inserted into some particular
table is known only at much higher levels (not even the same plan node).

I've thought about using our "errcontext()" mechanism to help with this,
but there's still a lot of additional infrastructure that would be needed
... and that infrastructure would not be without cost.  I'm afraid it
would result in measurable slowdowns in query execution.  Not sure if
people would think that's a good tradeoff.

            regards, tom lane


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

Предыдущее
От: Edson Richter
Дата:
Сообщение: Re: Add column name to error message?
Следующее
От: Andy Colson
Дата:
Сообщение: Re: Optimizing CartoDB's JenksBins function