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 1vXN3d-008gFm-1S for pgsql-general@arkaria.postgresql.org; Sun, 21 Dec 2025 17:17:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vXN3c-00C7JH-1D for pgsql-general@arkaria.postgresql.org; Sun, 21 Dec 2025 17:17:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vXN3c-00C7Iv-05 for pgsql-general@lists.postgresql.org; Sun, 21 Dec 2025 17:17:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vXN3b-001q3X-0w for pgsql-general@lists.postgresql.org; Sun, 21 Dec 2025 17:17:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5BLHHGb9138368; Sun, 21 Dec 2025 12:17:16 -0500 From: Tom Lane To: Adrian Klaver cc: Igor Korot , "David G. Johnston" , Laurenz Albe , "pgsql-generallists.postgresql.org" Subject: Re: PQexecPrepared() question In-reply-to: <699b6649-6841-48a7-8182-b92d28a70ff7@aklaver.com> References: <2547700.1765940917@sss.pgh.pa.us> <9a0ce31a49f149d8d982d2b359095560655f781e.camel@cybertec.at> <699b6649-6841-48a7-8182-b92d28a70ff7@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Sun, 21 Dec 2025 07:34:39 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <138366.1766337436.1@sss.pgh.pa.us> Date: Sun, 21 Dec 2025 12:17:16 -0500 Message-ID: <138367.1766337436@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > It is not the same setup, in your original question you are hand writing > code not running a script through the ODBC driver. Best bet is the ODBC > driver is picking up the client(Windows) encoding and passing it to the > server. It might be the other way around. psql absolutely will try to infer an encoding from its environment, but perhaps the ODBC driver does not, or does it differently. In any case, "SHOW client_encoding" in both the working and non-working contexts would yield useful information. regards, tom lane