]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: retain pgconn on OperationalError 1247/head
authorErik Wienhold <ewie@ewie.name>
Wed, 14 Jan 2026 13:42:18 +0000 (14:42 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 25 Jan 2026 13:06:48 +0000 (13:06 +0000)
commitb5573ec522ef54c60b9986dcede4023deef9c1d1
tree755a3fae0003fcbe73b4c8daff21780a6f4e5bee
parent38b2a5bdbb313bb5a0a2b064f5879413b132aefb
fix: retain pgconn on OperationalError

When multiple connection attempts fail, a new OperationalError with the
combined attempt errors is raised without retaining the pgconn attribute
of the original attempt errors.  Fix this by assigning the pgconn from
the last attempt error.
docs/news.rst
psycopg/psycopg/connection.py
psycopg/psycopg/connection_async.py
tests/test_connection.py
tests/test_connection_async.py