Re: error codes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: error codes
Date
Msg-id 16462.1026935876@sss.pgh.pa.us
Whole thread Raw
In response to error codes  (nconway@klamath.dyndns.org (Neil Conway))
Responses Re: error codes  (nconway@klamath.dyndns.org (Neil Conway))
List pgsql-hackers
nconway@klamath.dyndns.org (Neil Conway) writes:
> Should every elog() have an error code?

I believe we decided that it'd be okay to use one or two codes defined
like "internal error", "corrupted data", etc for all the elogs that are
not-supposed-to-happen conditions.  What error codes are really for is
distinguishing different kinds of user mistakes, and so that's where
you need specificness.

> How should the backend code signal an error with an error number?

Please read some of the archived discussions about this.  All the points
you mention have been brought up before.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Eric Redmond"
Date:
Subject: GiST Indexing
Next
From: nconway@klamath.dyndns.org (Neil Conway)
Date:
Subject: Re: error codes