Re: SQLSTATEs for warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQLSTATEs for warnings
Date
Msg-id 7526.1059745532@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQLSTATEs for warnings  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> I suspect though that the spec is assuming that the SQLSTATE code is the
>> *only* way for the application to determine whether the message is
>> success, warning, or error.

> The severity field is useless, because it contains localized text that
> cannot be evaluated by a program.

Fair point.

> Also, neither the severity field nor
> the error/notice message distinction is necessarily available in
> interfaces that work at a layer above libpq (e.g., embedded SQL).

An interface library would have to really go out of its way to make
errors and notices look alike, at least if it's built atop libpq.
I think this argument is pretty weak.  But you're right about severity.

>> AFAICS the alternative to misusing error-class SQLSTATEs as warnings is
>> that we invent implementation-specific warning codes.

> I don't see that as being allowed.

Hm?  Surely we can invent implementation-defined warning codes in the
ranges 015xx-019xx and 01Ixx-01Zxx.  If not, what other alternative
do you propose?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Another nasty pg_dump problem
Next
From: Robert Treat
Date:
Subject: Fwd: Re: [ANNOUNCE] PostgreSQL Weekly News - July 30th 2003