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 1vWFnn-00G3Nc-24 for pgsql-general@arkaria.postgresql.org; Thu, 18 Dec 2025 15:20:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWFnl-002ko9-36 for pgsql-general@arkaria.postgresql.org; Thu, 18 Dec 2025 15:20:26 +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 1vWFnl-002ko1-22 for pgsql-general@lists.postgresql.org; Thu, 18 Dec 2025 15:20:26 +0000 Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWFnk-001Lfr-27 for pgsql-general@lists.postgresql.org; Thu, 18 Dec 2025 15:20:25 +0000 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-786d1658793so6160667b3.1 for ; Thu, 18 Dec 2025 07:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766071224; x=1766676024; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=hpqzM2WH0SbFOdIXxI9h0PM6IWztSJD6vglWCSJetGw=; b=fhngrU2El0RGlOrqZOanIH9PVZ7VAaTrmxTcbaz2HAHd7CPDnVPKvKgqOKkm/KwtPn +izpzATlrhh2ZqpbuXje4m0eqzNGkOiB2GH+KTzcwIhSnwhLFZHPvBbkBbWf7lM7ZmHP WV2np58G2NEiKMtGrycSkd2FaEapEnujWdEIQWMm8GhHo4du5+4kfSaLeH4SlRtkhBvf +9CsxqBoJmEDoEh+6vMJpOTu616GeyfUZjPDCB2t1RSycqYJfO9tugiTABTqwIqDkhgF cSyjSv9XklMFOy4j9uxGsrNYYnVQepDfETZa4UpdbFgj9QVEhdxdd6OF7vm8mBuC6apW emlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766071224; x=1766676024; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hpqzM2WH0SbFOdIXxI9h0PM6IWztSJD6vglWCSJetGw=; b=rULCXNHAnRlsn3N6a5VijQeDySGkMrub+lfopp9YwZNFGOX4T03xgX+OYO+/JWft96 hVK34R4heCt7H286Raj9Yrb3VR+iAOPjIi0yso2T/feuCUKZzAuk7XjypTD3Z1yuDRZm o07RVh3KmnAC6BO6S2ZK+Rgn3aZOeuYb0dJHo5Rnnlgycpf3kMtuNkOnFRcIIIWxyuf8 YfcYqkdThTCPN7+my4JUA+n9Aclj6Is4XQH7fcs9Vw9KuJafH43GwBmpigRR3V+RiE74 UNHzpy7vk0Qx/PyugW+vlCRSAvzBXRIih9r0JS5e3w3qjFsOc6mcEBq3tQiRBL4jjLw3 2D8g== X-Forwarded-Encrypted: i=1; AJvYcCVxppLNOtbYlnYsTnqTO7Z2jf5q6YLVKIcERCCFpvR5Tg9z/DH1LAoJ94htgsb17jScby7JJDqxKFgk0OYV@lists.postgresql.org X-Gm-Message-State: AOJu0YxVHEbpt0RBqB9w11nl64dapeGsHyMDEAX4Qk8C68QgcxMPX8S3 XtESDiizJG7SMLN73h4vWj0lOSy6vClkC7RYEmCTqctSy4qepr3tfCxoVkEmR0o2HdC+YWkMYAk e24kc7RpbWMX8d7QeGiH3nE5fQMcAnus= X-Gm-Gg: AY/fxX5keqX+p7zb5TC5x0wqG0fRRWt0O71itCwcfu3OBU6D8Tqs48kZSSLCp0L2cVI RcjefoQw18/dLb4/cHWhOgbIc6re7dWnQkjSzt2auwUxlE784H6ZFDy0VGom0VdAbYLI95RGRvM 8ngYIQDWRtJRVefnFqte8+TFiy1FOeNNHB1Bl45h9U/VMLB/Fl33BkphxzkjqBywUuvdkDg9NgW O/cRbLLS/McZcOAufh8Kuvp2JRx+eJLZeSwFn7YONSE4PnOyEdsS27+xk8FrAlZSzhkGsPZ5fBU BXYwcBYQxk/2DJh788lvq48dIQ== X-Google-Smtp-Source: AGHT+IHXaGpC3G1Ku5P4wIubET6TdPLJq5JRuXl14z9mvbBusfPtQ2+mwwrHLEo2hk3U6uYC99VyMKIhtdL7Cs9xPNA= X-Received: by 2002:a05:690c:45c6:b0:78f:a561:b3ca with SMTP id 00721157ae682-78fa561c0c7mr61623627b3.43.1766071223462; Thu, 18 Dec 2025 07:20:23 -0800 (PST) MIME-Version: 1.0 References: <2547700.1765940917@sss.pgh.pa.us> <9a0ce31a49f149d8d982d2b359095560655f781e.camel@cybertec.at> In-Reply-To: <9a0ce31a49f149d8d982d2b359095560655f781e.camel@cybertec.at> From: Igor Korot Date: Thu, 18 Dec 2025 07:20:12 -0800 X-Gm-Features: AQt7F2plFnfARjdlMgmVfxztJTBr0QDjjYC8uMcuot8-nbc61ptM4UScFSK24sw Message-ID: Subject: Re: PQexecPrepared() question To: Laurenz Albe , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000ec2eb606463b7fc6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ec2eb606463b7fc6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Dec 16, 2025 at 11:32=E2=80=AFPM Laurenz Albe wrote: > On Tue, 2025-12-16 at 21:53 -0800, Igor Korot wrote: > > Is there some default value for client_encoding? > > The default value for a client connection is whatever the parameter > "client_encoding" was set to in the PostgreSQL server configuration. Imagine following scenario: I have 2 machines. One is running PG server on *nix. Second is my app on Windows. An application starts for the first time. What is =E2=80=9Cclientencoding in this case? Thank you. > > But that value can be overridden in several ways: > > - explicitly by setting "client_encoding" in the connect string > > - with the SQL statement SET by the client > > - if the client has "client_encoding=3Dauto", by the encoding set in > the client's environment > > - by setting the PGCLIENTENCODING environment variable > > Yours, > Laurenz Albe > --000000000000ec2eb606463b7fc6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Tue, Dec 16, 2025 at 11:= 32=E2=80=AFPM Laurenz Albe <= laurenz.albe@cybertec.at> wrote:
On Tue, 2025-12-16 at 21:53 -0800, Igor Korot wrote:
> Is there some default value for client_encoding?

The default value for a client connection is whatever the parameter
"client_encoding" was set to in the PostgreSQL server configurati= on.

Imagine follo= wing scenario:

I have 2 = machines. One is running PG server on *nix. Second is my app on Windows.

An application starts for = the first time.

What is = =E2=80=9Cclientencoding in this case?

Thank you.



But that value can be overridden in several ways:

- explicitly by setting "client_encoding" in the connect string
- with the SQL statement SET by the client

- if the client has "client_encoding=3Dauto", by the encoding set= in
=C2=A0 the client's environment

- by setting the PGCLIENTENCODING environment variable

Yours,
Laurenz Albe
--000000000000ec2eb606463b7fc6--