public inbox for [email protected]
help / color / mirror / Atom feedFrom: shashi B savarn <[email protected]>
To: [email protected]
Subject: Intermittent hang in SQLConnect (ODBC, PostgreSQL 15, Windows)
Date: Mon, 22 Jun 2026 13:49:19 +0530
Message-ID: <CA+4uE8JyjKfGuZP2c_XDtxdd6O65q+RHDJRr5=Q6UOHcRLErVg@mail.gmail.com> (raw)
--0000000000004411740654d34d3f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi all,
We are encountering an intermittent issue where our Windows-based
application hangs indefinitely during SQLConnect when connecting to a
PostgreSQL server via ODBC.
Environment
- PostgreSQL version: 15.0.15.25315
- ODBC driver: psqlODBC 16.00.0007
- Connection type: ODBC using certificate-based authentication
- Deployment: Application and PostgreSQL server both run on the same
machine (localhost)
Application Behavior
- The application maintains:
- Some long-lived persistent connections
- A few short-lived connections (3=E2=80=934) that are opened/closed
periodically
- Connection pooling is enabled (we also tested with pooling disabled
and reduced timeouts=E2=80=94no change)
Configuration
- Connection timeout is explicitly set before calling SQLConnect
- TCP keepalive parameters are configured
- Both settings are visible in PostgreSQL ODBC trace logs
Issue Description
On a subset of systems, intermittently (roughly once a week, sometimes more
frequently), the SQLConnect call:
- Hangs indefinitely
- Does not return or timeout
Observations / Troubleshooting
- Initially suspected Microsoft Defender or network filtering:
- Added PostgreSQL data directory to exclusions =E2=86=92 no improvem=
ent
- No network filtering/firewall issues observed
- Adjusted connection pooling and timeout values =E2=86=92 no impact
Call Stack During Hang
mswsock!WSPStartup
mswsock!WSPStartup
ws2_32!select
libpq!PQsocketPoll
libpq!PQsocketPoll
libpq!PQgetResult
psqlodbc35w!Ordinal94
psqlodbc35w!Ordinal94
psqlodbc35w!Ordinal94
psqlodbc35w!SQLConnectW
odbc32!SQLConnectW
odbc32!ODBCSetTryWaitValue
comsvcs!DispManGetContext
comsvcs!DispManGetContext
odbc32!SQLDriverConnectW
odbc32!SQLDriverConnectW
odbc32!SQLFreeStmt
odbc32!SQLConnectW
odbc32!SQLConnect
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Intermittent hang in SQLConnect (ODBC, PostgreSQL 15, Windows)
In-Reply-To: <CA+4uE8JyjKfGuZP2c_XDtxdd6O65q+RHDJRr5=Q6UOHcRLErVg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox