public inbox for [email protected]  
help / color / mirror / Atom feed
From: Igor Korot <[email protected]>
To: Tom Lane <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: Laurenz Albe <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: PQexecPrepared() question
Date: Sun, 21 Dec 2025 11:44:49 -0800
Message-ID: <CA+FnnTxCCoA+ju+-HAde8t8kmQt6Qm58oP5z2U2eZGHr7qAf6Q@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CA+FnnTygjVvSmzTHnvteuL4KEC=0P_+mF8Kn84JtNGZWUGxpUA@mail.gmail.com>
	<[email protected]>
	<CA+FnnTxO6kam9=mRonvsnUA1OxJxdDdQsj+ubdgFNNb9b3WMPQ@mail.gmail.com>
	<[email protected]>
	<CA+FnnTzE34VJWR7xkymaKEwXiiQ8j3o03m0+qcQsRr2JkRQLwQ@mail.gmail.com>
	<CAKFQuwZaf2quGaqsGAj4+rVVCebOwU3JjbMUJPxxj6NeF_O_gA@mail.gmail.com>
	<CA+FnnTwZUo-ZRZ4if_ngXXkYgtOCsmMp1uFpsMFkG5AOmRxX4Q@mail.gmail.com>
	<CAKFQuwYSM2xMxX+v8LAhJFG3kB1O-VBtV3eo3fj0ag3rGJ=ehQ@mail.gmail.com>
	<CA+FnnTzqQbBMnMyX3fz44tL0bYykDU=qcUpvT=vUy+cp8Q6vfw@mail.gmail.com>
	<[email protected]>
	<[email protected]>

Hi, Tom,

On Sun, Dec 21, 2025 at 9:17 AM Tom Lane <[email protected]> wrote:
>
> Adrian Klaver <[email protected]> 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.

Adding following code:

        SQLHSTMT stmt;
        SQLWCHAR value[25];
        ret = SQLAllocHandle( SQL_HANDLE_STMT, m_hdbc, &stmt );
        ret = SQLExecDirect( stmt, L"SHOW client_encoding", SQL_NTS );
        ret = SQLBindCol( stmt, 1, SQL_C_WCHAR, &value, 25, 0 );
        ret = SQLFetch( stmt );
        ret = SQLFreeHandle( SQL_HANDLE_STMT, stmt );

the value of the "value" variable is still "UTF8".

Thank you.

>
>                         regards, tom lane






view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: PQexecPrepared() question
  In-Reply-To: <CA+FnnTxCCoA+ju+-HAde8t8kmQt6Qm58oP5z2U2eZGHr7qAf6Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox