]> 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:56:46 +0000 (16:56 +0200)
commitae5c84c574c85ea8243a7382c94a1641bb10162a
tree33b5cc8e793fa16a02e1cfce58fe9d2f9d3a303b
parent6c6d9907f29866d3416bfa4d00fe8a63c06508e6
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