Problem with client_encoding and PsqlODBC driver. - Mailing list pgsql-odbc

From Kadri Raudsepp
Subject Problem with client_encoding and PsqlODBC driver.
Date
Msg-id CA+qYNGODy66NzmNaw7pp7Gpz+Ta1DCTeFt_wbZJViDLdC6UqMg@mail.gmail.com
Whole thread Raw
Responses Re: Problem with client_encoding and PsqlODBC driver.
List pgsql-odbc
Hello, 

I have some trouble with client_encoding using psqlodbc driver and - being unable to solve it - was hoping you would be able to help me.

I need to import large amount of data to SQL Server from postgres database. I'm using psqlodbc driver version 9.03.04.00, Microsoft SQL Server 2012 and postgres version 9.2. My postgres cluster has the encoding SQL_ASCII and database encoding is LATIN1.

I tried both Unicode(x64) and ANSI(x64) drivers, writing "SET CLIENT_ENCODING TO 'LATIN1'" to Connect Settings textbox. For both drivers, connection is successful and I use openquery to read the data, but my text data is all garbled.

Looking into the driver log I can see that the client_encoding is indeed set to LATIN1 as expected, but after that cc_lookup_characterset is called and with that the encoding is changed to UTF8 with Unicode driver and - I'm not sure what happens with ANSI driver, but the result does not look like desired. I have attached a log file that contains the logs for both driver's connection test.

Is there a setting I've overlooked or an action I could take to have the driver not to override my desired client_encoding? Am I doing something wrong altogether? Or is there maybe an older version of the driver that doesn't behave this way?

Thank you in advance and all the best,
Katie
Attachment

pgsql-odbc by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Odbc through vpn
Next
From: Enrico Pirozzi
Date:
Subject: Re: Odbc through vpn