public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Josh Kupershmidt <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Todo item: Include the symbolic SQLSTATE name in verbose error reports
Date: Mon, 25 May 2026 14:58:11 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAK3UJRGc2RKfQMjwVDAwsuOJuobq3d4+Qf9KWK1NHmK1vaqyxQ@mail.gmail.com>
References: <CAK3UJRGc2RKfQMjwVDAwsuOJuobq3d4+Qf9KWK1NHmK1vaqyxQ@mail.gmail.com>
Josh Kupershmidt <[email protected]> writes:
> Attached is a patch implementing an old feature request on the wiki's Todo:
> "Include the symbolic SQLSTATE name in verbose error reports"
I kind of doubt that this is actually useful (which presumably is
the reason the TODO item has languished uncompleted for so long).
The first problem is that the SQL spec's list of error codes isn't
very granular, so that there are many cases where different errors
with different messages have been mapped to the same SQLSTATE.
You are way better off to read the message text than to believe
that the SQLSTATE is a useful summary.
The second problem is that the proposed implementation relies on
libpq to know the server's list of SQLSTATEs, with obvious risks
for cross-version skew.
I also wonder if this wouldn't break some applications that are
expecting specific output from psql, or for that matter from
anything else relying on libpq's error message formatting.
No doubt such apps could be fixed, but the cost/benefit ratio
just doesn't seem all that attractive.
regards, tom lane
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Todo item: Include the symbolic SQLSTATE name in verbose error reports
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox