Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbZsW-002g49-1T for pgsql-general@arkaria.postgresql.org; Mon, 22 Jun 2026 08:19:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbZsV-005Gx0-1S for pgsql-general@arkaria.postgresql.org; Mon, 22 Jun 2026 08:19:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbZsV-005GwY-0J for pgsql-general@lists.postgresql.org; Mon, 22 Jun 2026 08:19:35 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wbZsS-00000001j1G-1wsb for pgsql-general@postgresql.org; Mon, 22 Jun 2026 08:19:34 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-c0c5d170ad4so205736466b.3 for ; Mon, 22 Jun 2026 01:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782116371; cv=none; d=google.com; s=arc-20240605; b=OIWcuJXal/qTfNplalDMu5IhqdFM+nvTOLgIaxPNaKppKpTJ46lBYrRMJ/YtA3rDoL 5ectlNHWyF8VYP63GKTWEw1R89LvchRYabpsmkGebxINH/lcdJwgppJsLDlgaKsfxb9N O1Oluzhm92HrcmX9PXp/S884oy3UifMLPSjjCYVDObg3QbZZOq7qXcw+q+qU7otxAAhL EP9FLGsqsHKSNYTaGzTGFVF9MhmLWBcw5iCKcm9E50vdzOuWVoVlmn8koA91gddtHcA7 mEzPeTNqCbMMm6/t/FfM/iiaRue9ODDPhyih4furI75uK7fAML++KEwzJky2XWCrbU4h Mdtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=LAcqWuaf7R6dXYZv4S44ZmMBUrLU4++Om12cNlXziIM=; fh=x9Jmr8+FtiCQKUvo/7/je6SkcsG+V48pI/LmEXQOSec=; b=GScumjNGqCsXcrNZ/u7mTrEP/qGlbPluY8mC2MT8kL6Un0CsN7v4rT/tesHFp6zTJW hu8hpLwXmeSQVuKvBOoW9Mo7ecdsxxTQc8RXUIwjMBVluYdlINCXpPy++XrsCJ0/Pg/G /nborVybbb7XLAqo60xsADl2WijC0R+MigUxMQJti7Jvet/TxYu4h8k4cOfBTskX2vQg E0TeHlNSVEmkmRIGy4VmnCnxmQuInxMRkt810KtGI4nVu2vdMNWX6gk2LghFI8CZoXar JBNAf76xDRgpAND9iORRr+pJsWinO98RvRMCeXojropR17XFkPpj9naG+zVLm8LC0Z+v 16tw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782116371; x=1782721171; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=LAcqWuaf7R6dXYZv4S44ZmMBUrLU4++Om12cNlXziIM=; b=WiROweSkhRXBCRcD3pFuvoysMqLBbKiD/3Dk4kVmDoR0YFZ2piv3zUKsubPAD1jvrb CyW/P7tpyF67Lqv/gZHvF6BR2rCAvyDe+a8KlHz3Jkjyi7aFyGdqp4ZuD3N6pXY6Yucu Mx46Y1Bvt0D+PV9NyNQJ4a4dTBV+/jxFFKQKBL0bftv1JZwRbUAFZ26uRQlELTmiQQBJ fmEfCM+JMCfJO2LrY1822LlcNc2ZC1ro4CnQiOKcwLLCyE57tALc9P/WC+oCp91z/1yE cZ23DlRhdL0drOBPj224aaPh26wNYPcDFgWJheUxMkLUgGji+BZJRxllnACcsQ2z/rIE y27A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782116371; x=1782721171; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LAcqWuaf7R6dXYZv4S44ZmMBUrLU4++Om12cNlXziIM=; b=Uz2T4NBBGju58ASaIQcyE+zsSO0K44tAg4PloOglqa+w0Ywg0F6iVdMJUaqIUL2n8+ uuvH7wn3l1jQ8bMlXKUXA3alTl1JMkA8Q4bYf6qyb+xXzLmobdBSoUnx0Z4RgZ1arv3E UE+BY5o93Z0NNcndIjD0UNit/ojV/h/QGV/2hsiLFYISw8idBAuxSMElBFBMTQINXcrU OV7+dya8S5gr7V9WN7CRDdHw7OCwXuFFFykMbokLyGStPmlxj1C7RiM2/AeTBwGolOEk n3WmWdxP6hNp47h0o3NIXUINa9ERIah8z2uymsRCyYwaBgu34ECnKsh/LiiaS4mL67fs Xvcg== X-Gm-Message-State: AOJu0Yy2lJpANVmbqk7O6hvjRkG7NibgmeWvk6kkprFcd4B3eXJOhsGB VluxQTCOaOz6XT0nKJMHk6Q9dOTaNTYziyM5pjpWKehB0/lqHekFy0ylSwxzAFfRQy4Wb/CV7Wx 3hNWnbdlfCOsSHxrGtHOZE9/FD0xjHP5i4erA X-Gm-Gg: AfdE7cnnYNP8ev3CtFocyCRtgCrNzmzEe3WnhHU3mYcBlLpcJnIpIjr1AAjcnw9lKEl jDC5RmkkVef8x4WRiQuQeYBt5JGXANRPWqxWA/rMElzCKgzVZvbDOGVUuqXEue+Hp2dzLSJ9NP4 u3VFNxK5ZVmZt6fhmKGRjpQ6oL05oiFYpG4O4kADvsT2G2RWxF8RiLWwARoW6/zABuc210bvIwy /J5NLT8UEKoa0Pk66B5JSdVrn3DJVvvMXO7A1sG0rXj5ykYqvsKlJlEqE4dRKIJNjHCQnW6 X-Received: by 2002:a17:907:e153:b0:c0c:fb79:ef83 with SMTP id a640c23a62f3a-c0cfb7a4f18mr195410866b.19.1782116371399; Mon, 22 Jun 2026 01:19:31 -0700 (PDT) MIME-Version: 1.0 From: shashi B savarn Date: Mon, 22 Jun 2026 13:49:19 +0530 X-Gm-Features: AVVi8CcXSn2waRuXGKkyWAE4i5NJPKnN3mQooFuVSLh3fUK8abOYfGGpfaYGWqg Message-ID: Subject: Intermittent hang in SQLConnect (ODBC, PostgreSQL 15, Windows) To: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="0000000000004411740654d34d3f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --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