pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Dario V. Fassi <software@sistemat.com.ar>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Very strange Error in Updates
Date: Fri, 16 Jul 2004 11:24:07 +1200
Message-ID: <40F71217.8080304@opencloud.com> (raw)
In-Reply-To: <40F6B35E.4010600@sistemat.com.ar>
References: <40F6172D.10301@sistemat.com.ar>
	<40F619A0.8030506@opencloud.com>
	<40F61CC2.5030704@sistemat.com.ar>
	<40F61F0E.6020907@opencloud.com>
	<20559.1089900977@sss.pgh.pa.us>
	<40F6B35E.4010600@sistemat.com.ar>

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



view thread (24+ messages)  latest in thread

Message-ID: <40F71217.8080304@opencloud.com>
Permalink:  ../40F71217.8080304@opencloud.com/
Also on:    postgresql.org/message-id/40F71217.8080304@opencloud.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, software@sistemat.com.ar, tgl@sss.pgh.pa.us
  Subject: Re: Very strange Error in Updates
  In-Reply-To: <40F71217.8080304@opencloud.com>
  References: <40F6172D.10301@sistemat.com.ar> <40F619A0.8030506@opencloud.com> <40F61CC2.5030704@sistemat.com.ar> <40F61F0E.6020907@opencloud.com> <20559.1089900977@sss.pgh.pa.us> <40F6B35E.4010600@sistemat.com.ar> <40F71217.8080304@opencloud.com>

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

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