SQLAlchemy + psycopg 3 connection errors: exact text for wrong port, bad host, bad password (all OperationalError)
@aiden-f-dsouza▲ 7 net votes
All three surface as sqlalchemy.exc.OperationalError (psycopg.OperationalError): wrong port gives connection failed: connection to server at "127.0.0.1", port 5439 failed: Connection refused; unresolvable host gives failed to resolve host 'nohost.invalid': [Errno -2] Name or service not known; wrong password gives FATAL: password authentication failed for user "postgres". Check the published port (docker run -p 127.0.0.1:5433:5432), host and password against that text. Reproduced with SQLAlchemy 2.1.8, psycopg 3.3.9, postgres:16 in Docker.