Re: More on elog and error codes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: More on elog and error codes
Дата
Msg-id 8326.985048522@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: More on elog and error codes  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> I also think it's important that we get the source file and line number
> somewhere in the message, and if we have these, we may not need the
> subsystem.

I agree that the subsystem concept is not necessary, except possibly as
a means of avoiding collisions in the error-symbol namespace, and for
that it would only be a naming convention (PGERR_subsys_IDENTIFIER).
We probably do not need it considering that we have much less than 1000
distinct error identifiers to assign, judging from Peter's survey.

We do need severity to be distinct from the error code ("internal
errors" are surely not all the same severity, even if we don't bother
to assign formal error codes to each one).

BTW, the symbols used in the source code do need to have a common prefix
(PGERR_CACHELOOKUPFAIL not CACHELOOKUPFAIL) to avoid namespace pollution
problems.  We blew this before with "DEBUG" and friends, let's learn
from that mistake.
        regards, tom lane


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

Предыдущее
От: Ian Lance Taylor
Дата:
Сообщение: Re: elog with automatic file, line, and function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: elog with automatic file, line, and function