Re: proposal: additional error fields

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Peter Geoghegan" <peter(at)2ndquadrant(dot)com>, "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: additional error fields
Date: 2012-05-01 14:08:57
Message-ID: 4F9FA8290200002500047623@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:

> Currently the following informal categories of error are bunched
> together at ERROR severity:
>
> * Integrity constraint violations
> * Very serious situations, like running out of disk space
> * Serious disasters that often relate to hardware failure, like
> "xlog flush request %X/%X is not satisfied --- flushed only to
> %X/%X"
> * Errors that if seen relate to a bug within PostgreSQL, with
> obscure error messages, as from most of the elog calls within the
> planner, for example.

You forgot a few:

* Syntax errors in submitted statements.
* State-related errors, like trying to execute VACUUM in a
transaction or trying to UPDATE a row in a READ ONLY transaction.
* Serialization failures.
* RAISE EXCEPTION from inside a function; often because of a
validation in a BEFORE trigger function. If you tilt your head just
right you can see these as constraint violations, but I think it is
different enough to deserve specific mention.
* Violations of security policy.
* Loss of connection to a client.

I'm sure I didn't cover them all, but the wide variety of causes
should be recognized when considering a change like adding a new
severity level. The fact is, these all are (or at least *should
be*) coded with a SQLSTATE to classify the nature of the problem.
Adding one more severity level forces us to examine every class of
error and determine whether it should be promoted to "severe".
Perhaps a better solution would be to allow some filtering of error
SQLSTATE values to determine what action is taken? Changes would be
more localized, and it would provide greater flexibility.

The comments earlier in the thread about this helping translation
don't make sense to me. In what way would a new severity level help
with that?

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-05-01 14:22:49 Re: extending relations more efficiently
Previous Message Robert Haas 2012-05-01 14:08:27 extending relations more efficiently