Re: Very strange Error in Updates - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Very strange Error in Updates
Date
Msg-id 40F71217.8080304@opencloud.com
Whole thread Raw
In response to Re: Very strange Error in Updates  ("Dario V. Fassi" <software@sistemat.com.ar>)
Responses Re: Very strange Error in Updates
Re: Very strange Error in Updates
List pgsql-jdbc
Dario V. Fassi wrote:
>
> My problem it's that the data is just inside the postgresql server (with
> SQL_ASCII encoding), inserted by Win32/ODBC clients.
>
> Now from JDBC I can't handle any row with any field that has one o more
> 8 bits characters.
> At same time , Win32/ODBC programs continue to use it without any problem.
> This situation let me in a hard to explain situation.

The problem, as I understand it from Tom's explanation, is that
SQL_ASCII only works if everyone is using the same client_encoding; the
server has no knowledge of the real underlying encoding of the data so
can't do conversions.

JDBC always uses a client_encoding of UNICODE. I don't know what ODBC
does, but apparently it's not using UNICODE.

Perhaps one option is to set the database encoding to UNICODE, and
either get the ODBC driver to issue an appropriate "SET client_encoding"
on connection setup (I don't know if ODBC lets you do this) or set the
default client_encoding in postgresql.conf to whatever is appropriate
for ODBC clients?

-O

pgsql-jdbc by date:

Previous
From: tgutierrez@unipamplona.edu.co
Date:
Subject: problema con el backend
Next
From: Oliver Jowett
Date:
Subject: Re: Very strange Error in Updates