]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: don't barf on errors with blank sqlstate
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 14 May 2022 08:22:44 +0000 (10:22 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 15 May 2022 14:58:50 +0000 (16:58 +0200)
commitf12b207dcb11475f17a929770250ab448822e9e3
tree4b86e57cd4ce0d7bfcf45fe901f4436545450550
parent6aa1e8f59d3e1ff30796ff77fa795effcbbc16dd
fix: don't barf on errors with blank sqlstate

Such messages are not entirely valid (sqlstate is documented to be
always present), however we receive them after a SHOW HELP in the
PgBouncer admin database.

The SHOW HELP actually does generate a sqlstate `00000` but the message
is somehow parsed incorrectly by the libpq, which goes on to report an
error:

    message contents do not agree with length in message type "N"

See #303. PgBouncer issue reported upstream in
https://github.com/pgbouncer/pgbouncer/issues/718
docs/news.rst
psycopg/psycopg/errors.py
tests/test_errors.py