Re: Practical sets of SQLSTATE values?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Practical sets of SQLSTATE values?
Date: 2003-05-30 19:20:32
Message-ID: Pine.LNX.4.44.0305301945470.1617-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:

> I've been starting to look at assigning SQLSTATE values to all the
> backend elog() calls, and have realized that the set of values defined
> by the spec is very, how you say, uneven. They have conditions as
> specific as "data exception/invalid time zone displacement value"
> (22009) and yet nothing for cases as obvious as "no such function"
> or "out of disk space". We're going to need a lot of implementation-
> defined SQLSTATE codes if we want the facility to be as useful as it
> should be.

In my mind, distinct error codes are only useful if the application can
react differently to the condition. Hence, "no such function" can be
equated to "no such <anything>" or a general "syntax error", because the
action of the application in all those cases is likely the same (perhaps
show error text to user and make him fix the command). Similarly, "out of
disk space" can be put into a general "internal server error" class
because in all those cases the action is the same (show error text to
administrator and make him fix the problem). How this extends to "invalid
time zone displacement value" is a little beyond my reach right now, but
in general we should be able to get away with relatively few distinct
error codes.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-05-30 19:36:04 Re: Practical sets of SQLSTATE values?
Previous Message greg 2003-05-30 19:06:38 Re: XML ouput for psql