We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db8ecc2 commit c9aaa9bCopy full SHA for c9aaa9b
1 file changed
asyncpg/connect_utils.py
@@ -1103,9 +1103,14 @@ async def __connect_addr(
1103
except (
1104
exceptions.InvalidAuthorizationSpecificationError,
1105
exceptions.ConnectionDoesNotExistError, # seen on Windows
1106
- ):
+ ) as exc:
1107
tr.close()
1108
-
+
1109
+ # Do not retry on wrong password (28P01) — the issue is credentials,
1110
+ # not SSL negotiation. Only pg_hba.conf rejections (28000) warrant a retry.
1111
+ if isinstance(exc, exceptions.InvalidPasswordError):
1112
+ raise
1113
1114
# retry=True here is a redundant check because we don't want to
1115
# accidentally raise the internal _RetryConnectSignal to the user
1116
if retry and (
0 commit comments