Re: Add column name to error description

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add column name to error description
Дата
Msg-id 794292.1711912501@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add column name to error description  (Erik Wienhold <ewie@ewie.name>)
Список pgsql-hackers
Erik Wienhold <ewie@ewie.name> writes:
> On 2024-03-31 15:22 +0200, Marcos Pegoraro wrote:
>> This is my first patch, so sorry if I miss something.

> Please make sure that tests are passing by running make check:

check-world, in fact.

> The format "%d-%s" is not ideal.  I suggesst "%d (%s)".

I didn't like that either, for two reasons: if we have a column name
it ought to be the prominent label, but we might not have one if the
TupleDesc came from some anonymous source (possibly that case explains
the test crash?  Although I think the attname would be an empty string
rather than missing entirely in such cases).  I think it'd be worth
providing two distinct message strings:

"Returned type %s does not match expected type %s in column \"%s\" (position %d)."
"Returned type %s does not match expected type %s in column position %d."

I'd suggest dropping the column number entirely in the first case,
were it not that the attnames might well not be unique if we're
dealing with an anonymous record type such as a SELECT result.

            regards, tom lane



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

Предыдущее
От: Michael Banck
Дата:
Сообщение: Re: Security lessons from liblzma
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Security lessons from liblzma