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.
regards, tom lane