From 9279c5f819ad6b7da48cd53923d25c45150a378a Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Sat, 13 Jun 2026 21:40:45 +0800 Subject: [PATCH] fix: use libpq ssl semantics for runtime postgres (#1143) --- internal/db/runtime-store.test.ts | 1 + internal/db/runtime-store.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/db/runtime-store.test.ts b/internal/db/runtime-store.test.ts index de9867d5..7160a84a 100644 --- a/internal/db/runtime-store.test.ts +++ b/internal/db/runtime-store.test.ts @@ -154,6 +154,7 @@ test("postgres pool config makes HWLAB_CLOUD_DB_SSL_MODE authoritative over URL assert.deepEqual(required.ssl, { rejectUnauthorized: false }); assert.equal(new URL(required.connectionString).searchParams.get("sslmode"), "require"); + assert.equal(new URL(required.connectionString).searchParams.get("uselibpqcompat"), "true"); }); test("configured postgres runtime passes normalized pool config to pg", async () => { diff --git a/internal/db/runtime-store.ts b/internal/db/runtime-store.ts index e5f180c4..cc2af0b3 100644 --- a/internal/db/runtime-store.ts +++ b/internal/db/runtime-store.ts @@ -1356,6 +1356,7 @@ function normalizePostgresConnectionStringForSslMode(dbUrl, sslMode) { } if (sslMode !== "disable") { url.searchParams.set("sslmode", "require"); + url.searchParams.set("uselibpqcompat", "true"); } return url.toString(); }