Re: SQLSTATE of notice PGresult - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQLSTATE of notice PGresult
Date
Msg-id 25146.1285166730@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQLSTATE of notice PGresult  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Sep 22, 2010 at 4:18 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
>> Okay, as Robert points, "00000" code in successful messages seems as waste
>> of bytes. But according to the documentation, "All messages emitted by the
>> PostgreSQL server are assigned five-character error codes that follow the
>> SQL
>> standard's conventions for "SQLSTATE" codes." - the first sentence of
>> http://www.postgresql.org/docs/9.0/static/errcodes-appendix.html

> Sounds like that wording needs some adjustment.

That wording is correct as it stands.

If I recall the previous discussion here, the problem is that the OP
is reading that and thinking that it applies also to errors generated
internally by libpq.  We should, but don't, have any support for
assigning SQLSTATEs to those.  But the server always emits a SQLSTATE
when sending a notice or error message --- read
send_message_to_frontend() if you doubt it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Needs Suggestion
Next
From: Tom Lane
Date:
Subject: Re: snapshot generation broken