Re: SQLSTATEs for warnings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SQLSTATEs for warnings
Дата
Msg-id 7526.1059745532@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SQLSTATEs for warnings  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Another nasty pg_dump problem
Следующее
От: Robert Treat
Дата:
Сообщение: Fwd: Re: [ANNOUNCE] PostgreSQL Weekly News - July 30th 2003