Re: More on elog and error codes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: More on elog and error codes
Date
Msg-id 8326.985048522@sss.pgh.pa.us
Whole thread Raw
In response to Re: More on elog and error codes  (Philip Warner <pjw@rhyme.com.au>)
List 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 by date:

Previous
From: Ian Lance Taylor
Date:
Subject: Re: elog with automatic file, line, and function
Next
From: Tom Lane
Date:
Subject: Re: elog with automatic file, line, and function