Re: PQexecPrepared() question

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PQexecPrepared() question
Date: 2025-12-20 04:10:12
Message-ID: CA+FnnTyYBNwbzFs5GqO+SMg3g60jPTsnmFwTV=_s_YboGo-68A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, ALL,

On Fri, Dec 19, 2025 at 9:17 AM Igor Korot <ikorot01(at)gmail(dot)com> wrote:

> Hi, Lauren’s,
>
> On Thu, Dec 18, 2025 at 11:43 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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 “clientencoding 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’t 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
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2025-12-20 06:24:47 Re: PQexecPrepared() question
Previous Message Adrian Klaver 2025-12-19 21:21:11 Re: Fwd: PQexecPrepared() question