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 1vWoIW-009qEW-0T for pgsql-general@arkaria.postgresql.org; Sat, 20 Dec 2025 04:10:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWoIU-009eW5-0R for pgsql-general@arkaria.postgresql.org; Sat, 20 Dec 2025 04:10: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 1vWoIT-009eVx-27 for pgsql-general@lists.postgresql.org; Sat, 20 Dec 2025 04:10:26 +0000 Received: from mail-yx1-xb130.google.com ([2607:f8b0:4864:20::b130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWoIS-001brk-2D for pgsql-general@lists.postgresql.org; Sat, 20 Dec 2025 04:10:25 +0000 Received: by mail-yx1-xb130.google.com with SMTP id 956f58d0204a3-6446c924f9eso2267018d50.1 for ; Fri, 19 Dec 2025 20:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766203823; x=1766808623; 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=3T0yr8/fzACm3EPx2yjvOHhSD9pg+cO6dwI3ldCunTE=; b=fSttL3YRPXq59hwJlVivRAquwGbW40xuvYeHXFTZ7zMl3EM1giFaoW4ppQ1frdkVxB Kevh9LrouSRYMpIQjTzSS9P+WaFMsutZ9PZdA17hFGGm9S1owdCoLyxErA2D0iKbFbdM pxBrsCEe4dmXWoS15P29fyFT+TghPjBaQf4iAqXd7BFxS2VgyEZS0rOS4kEvb0S5QE6L KFKJEi5C0zaFkPBqS5f16yvbfABzgBRLUp8zLWI/yIhtQkUynY5V6F41ph7X4i9qdHNc EXVuK50jwAEhcb4xPhyOySxcr7PM4k8zEIPNfaR4syOGxnfmiWyMNrmeVeKGLFDmadnp qKmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766203823; x=1766808623; 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=3T0yr8/fzACm3EPx2yjvOHhSD9pg+cO6dwI3ldCunTE=; b=fS+jSwUwRgpJITYxSRPhOvxfB9CekWcWL3/oVUkxwnaz+RuLPkqtMeSYV/UybbUIZX c64hHiOONZ7VuFYFi6f7M8NVep7AVOXndp+rJksS+pKmdIgSqIdEqc3u65srGkV9GloN Czk8/M2ND+yTEo4PnbfOGb0JcA78aqwfAm8uigYh2EucmY25NDEuEwg1JSQutJBrUVAa iI8p4FLvdW7rHfgN/x2xb4sUdlqS8qQYqwZ0NXeJRZYHa375AlS3NXvcO5Eu2uPfQPp1 cJvf8ewI9NjPh1eILm1lZN2uyY0hqbRRBXb7pe3h1A6CN4r/KK6XDzzq4oo8/wcNkJgI pQxw== X-Forwarded-Encrypted: i=1; AJvYcCVFxbk78QkAcfmuqDejAbDx1FTnyROmNROBbFrwSkMQu4wk10MFjvzYFPC2glq2dPNqIByqOcHMqt2jW6r9@lists.postgresql.org X-Gm-Message-State: AOJu0YynRWqC3d2j6mWjSgZRn1ytTEbmgdRgpfrfUw3RrzYcuNEe8/Ax mM8TeClThkPaCO04DNSnKyD1pDPH1o4lE0S5AiFYes9EYVjjaMQWE8N4EQTOTJT5pu7ygkK/Z2T GlScgvmSEbHvY/TEItD7vo7tvdvUvzmg4JVx9 X-Gm-Gg: AY/fxX7JdKdC8pYc2+SlulADZv+HK8QLTEs6Xpn2A+wnRLgvvJ8QDWrsKOoJSShZtrK oANsmhk2rOhSXcDNHc4SfuTJJ1V2YM0h0CFL/odUSVTkNxsUXqAvT9/Gt/ck64sKtc63DE9rIJS kaafv2lEhDN2KTwR+QbWS+fBGr87XLv9SPkJdBkX37ttDCP37iHS/v5C1xbEKJIwOGv7MvV0+nu 3NaPupotRXQgZnvO8LBM7Ia23PrdcoEo6Krtiy1bTDB5EuAhrguuKmEdojDtmwr+W5Q70v/61fR +7OyNAtyqq3oVcAyCL3+fy1wdx2G9c/zI5MNyyg= X-Google-Smtp-Source: AGHT+IH5pQ7WBtCjNt21/wftJ9P81SNJdEX28LxFF1EMduLfKNsxUKi1GFcpk+XHAbUU1LG3gkVpgBRXaKVn8D81NGQ= X-Received: by 2002:a53:bacb:0:b0:640:db91:33c4 with SMTP id 956f58d0204a3-6466a87f00cmr3149912d50.18.1766203823287; Fri, 19 Dec 2025 20:10:23 -0800 (PST) MIME-Version: 1.0 References: <2547700.1765940917@sss.pgh.pa.us> <9a0ce31a49f149d8d982d2b359095560655f781e.camel@cybertec.at> In-Reply-To: From: Igor Korot Date: Fri, 19 Dec 2025 20:10:12 -0800 X-Gm-Features: AQt7F2ojbSE3gpqManVVN_4NDNv3YDzS4QB1wOLhVrgIvUnb-enTw4Fd7-XXkbY Message-ID: Subject: Re: PQexecPrepared() question To: Laurenz Albe , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000007cf13906465a5fb6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007cf13906465a5fb6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, ALL, On Fri, Dec 19, 2025 at 9:17=E2=80=AFAM Igor Korot wro= te: > Hi, Lauren=E2=80=99s, > > On Thu, Dec 18, 2025 at 11:43=E2=80=AFPM Laurenz Albe > wrote: > >> On Thu, 2025-12-18 at 07:20 -0800, Igor Korot wrote: >> > 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? >> >> If I read the code correctly: >> >> - if PGCLIENTENCODING is set in the environment of the client executable= , >> that > > > No it is not. > > >> >> - otherwise, if "client_encoding" is set on the server, that > > I just checked the postgres.conf. This file does not have any client_encoding. > I guess I is. > But what is the purpose of setting client encoding on the server? It is > for the client > > Thank you. > > >> >> - otherwise, SQL_ASCII > > Which means that this is an encoding that will be used. But then I don=E2=80=99t understand anything. The code I posted above worked fine on SELECT, but INSERT failed. If the SQL_ASCII is the encoding used both operations should fail. Or both succeeds. Could someone explain what happened? Thank you. >> >> Yours, >> Laurenz Albe >> > --0000000000007cf13906465a5fb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, ALL,

On Fri, Dec 19, 2025 a= t 9:17=E2=80=AFAM Igor Korot <ikor= ot01@gmail.com> wrote:
Hi, Lauren=E2=80=99s,

On Thu, Dec 18, 2025 at 11:43=E2=80= =AFPM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Thu, 2025-12-18 at 07:20 -0800, Igor Korot wrote:
> 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?

If I read the code correctly:

- if PGCLIENTENCODING is set in the environment of the client executable, t= hat

No it is not.=



- otherwise, if "client_encoding" is set on the server, that

I just checked the postgres.conf.

This file does not have any client_encoding.



I guess I is.<= /div>
But what is the purpose of setting client encoding o= n the server? It is for the client=C2=A0

<= div dir=3D"auto">Thank you.

<= br>
- otherwise, SQL_ASCII

Which means that this is an encoding that wi= ll be used.

But then I d= on=E2=80=99t understand anything.

The code I posted above worked fine on SELECT, but INSERT failed.=

If the SQL_ASCII is the= encoding used both operations should fail. Or both succeeds.

Could someone explain what happened?<= /div>

Thank you.




Yours,
Laurenz Albe
--0000000000007cf13906465a5fb6--