Re: Very strange Error in Updates

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: "Dario V(dot) Fassi" <software(at)sistemat(dot)com(dot)ar>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Very strange Error in Updates
Date: 2004-07-15 23:24:07
Message-ID: 40F71217.8080304@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2004-07-15 23:29:29 Re: Point in Time Recovery
Previous Message Glen Parker 2004-07-15 23:19:28 Re: Point in Time Recovery

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-07-15 23:34:45 Re: Very strange Error in Updates
Previous Message tgutierrez 2004-07-15 22:34:24 problema con el backend