odbc problem on Japanese windows machine

odbc problem on Japanese windows machine

am 13.12.2007 14:51:41 von Yuval_Sofer

This is a multi-part message in MIME format.

------_=_NextPart_001_01C83D8F.4AF118C7
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,=20

=20

I am trying to use postgres odbc driver on windows Japanese machine, to
test connection to a remote postgres database. The database has latin1
encoding.=20

=20

Connection tests to databases with latin1 encoding fail with this error
message:=20

=20

fatal: conversion between SJIS and LATIN1 is not supported

=20

Connection tests to databases with utf8 encoding succeed.

=20

I checked both server source and odbc driver source and saw that the
message comes from postgres server code.=20

=20

It seems that the postgres odbc sends SJIS characters to the latin1
database and it cannot convert.

I know that the next command retrieves with the same error:=20

=20

alter database set client_encoding=3D"SJIS"

=20

Is there any switch in the code to bypass local machine encoding?

Why does it send Japanese encoding?=20

Postgres odbc driver is not Japanese application. For what the
conversion is needed?=20

Is there any way to overcome this problem?=20

=20

Steps to reproduce error message:=20

=20

1. Put postgres odbc drivers (psqlodbc30a.dll and psqlodbc35w.dll) under
c:\windows\system32

=20

2. Update machine registry with next values:=20

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]

"PostgreSQL ANSI"=3D"Installed"

"PostgreSQL Unicode"=3D"Installed"

=20

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL ANSI]

"APILevel"=3D"1"

"ConnectFunctions"=3D"YYN"

"Driver"=3D"c:\windows\system32\PSQLODBC30A.DLL"

"DriverODBCVer"=3D"03.00"

"FileUsage"=3D"0"

"Setup"=3D" c:\windows\system32\PSQLODBC30A.DLL"

"SQLLevel"=3D"1"

"UsageCount"=3Ddword:00000001

=20

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL Unicode]

"APILevel"=3D"1"

"ConnectFunctions"=3D"YYN"

"Driver"=3D" c:\windows\system32\PSQLODBC35W.DLL"

"DriverODBCVer"=3D"03.51"

"FileUsage"=3D"0"

"Setup"=3D" c:\windows\system32\PSQLODBC35W.DLL"

"SQLLevel"=3D"1"

"UsageCount"=3Ddword:00000001

=20

3. Create datasource and test connection to latin1 encoding database:=20

Settings -> administrative tools -> data source (ODBC)=20

And then add system data source with postgres driver. Configure this
data source to=20

connect to latin1 postgres database.

=20

Thanks,=20

=20

Yuval Sofer
BMC Software
CTM&D Business Unit

DBA Team
972-52-4286-282
yuval_sofer@bmc.com =20

=20

=20

=20

Yuval Sofer
BMC Software
CTM&D Business Unit

DBA Team
972-52-4286-282
yuval_sofer@bmc.com

=20


------_=_NextPart_001_01C83D8F.4AF118C7
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">


charset=3Dus-ascii">









style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Hi,



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>I am trying to use postgres odbc =
driver on
windows Japanese machine, to test connection to a remote postgres =
database. The
database has latin1 encoding.



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Connection tests to databases with =
latin1
encoding fail with this error message:



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>fatal: conversion between SJIS and =
LATIN1
is not supported



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Connection tests to databases with =
utf8
encoding succeed.



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>I checked both server source and =
odbc
driver source and saw that the message comes from postgres server code. =



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>It seems that the postgres odbc =
sends SJIS
characters to the latin1 database and it cannot =
convert.



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>I know that the next command =
retrieves
with the same error:



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>alter database <db_name> set
client_encoding=3D"SJIS"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Is there any switch in the code to =
bypass
local machine encoding?



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Why does it send Japanese encoding? =



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Postgres odbc driver is not =
Japanese
application. For what the conversion is needed? =



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Is there any way to overcome this =
problem?



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:11.0pt;font-family:Arial;color:navy'>Step s to =
reproduce error
message:



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>1. Put postgres odbc drivers
(psqlodbc30a.dll and psqlodbc35w.dll) under =
c:\windows\system32



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>2. Update machine registry with =
next
values:



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>[HKEY_LOCAL_MACHINE\SOF TWARE\ODBC\OD=
BCINST.INI\ODBC
Drivers]



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"PostgreSQL
ANSI"=3D"Installed"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"PostgreSQL
Unicode"=3D"Installed"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>[HKEY_LOCAL_MACHINE\SOF TWARE\ODBC\OD=
BCINST.INI\PostgreSQL
ANSI]



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"APILevel"=3D"1"=



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"ConnectFunctions"=3D"=
;YYN"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"Driver"=3D"c:\window=
s\system32\PSQLODBC30A.DLL"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"DriverODBCVer"=3D"03=
..00"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"FileUsage"=3D"0"=
;



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"Setup"=3D"
c:\windows\system32\PSQLODBC30A.DLL"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"SQLLevel"=3D"1"=



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"UsageCount"=3Ddword:00000=
001



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>[HKEY_LOCAL_MACHINE\SOF TWARE\ODBC\OD=
BCINST.INI\PostgreSQL
Unicode]



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"APILevel"=3D"1"=



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"ConnectFunctions"=3D"=
;YYN"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"Driver"=3D"
c:\windows\system32\PSQLODBC35W.DLL"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"DriverODBCVer"=3D"03=
..51"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"FileUsage"=3D"0"=
;



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"Setup"=3D"
c:\windows\system32\PSQLODBC35W.DLL"



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"SQLLevel"=3D"1"=



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>"UsageCount"=3Ddword:00000=
001



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>3. Create datasource and test =
connection
to latin1 encoding database:



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Settings -> administrative tools =
->
data source (ODBC)



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>And then add system data source =
with
postgres driver. Configure this data source to =



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>connect to latin1 postgres =
database.



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Thanks, =



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>Yuval Sofer

BMC Software

CTM&D Business Unit



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'>DBA Team

972-52-4286-282

title=3D"mailto:yuval_sofer@bmc.com"> color=3Dnavy title=3D"mailto:yuval_sofer@bmc.com"> title=3D"mailto:yuval_sofer@bmc.com"> style=3D'color:navy'>yuval_sofer@bmc.com
:p>



style=3D'font-size:
11.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>Yuval Sofer

BMC Software

CTM&D Business Unit



style=3D'font-size:10.0pt;
font-family:Arial'>DBA Team

972-52-4286-282

href=3D"mailto:yuval_sofer@bmc.com">yuval_sofer@bmc.com
=
size=3D2 face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> >

style=3D'font-size:
12.0pt'> 









------_=_NextPart_001_01C83D8F.4AF118C7--

Re: odbc problem on Japanese windows machine

am 14.12.2007 07:35:52 von Hiroshi Saito

Hi.

Sorry late reaction...
It is the conversion which is not supported by PostgreSQL. It does not have
the conversion definition between LATIN1 and SJIS.
See,
http://www.postgresql.org/docs/8.2/static/multibyte.html#AEN 24142

Regards,
Hiroshi Saito

----- Original Message -----
From: Sofer, Yuval
To: pgsql-odbc@postgresql.org
Sent: Thursday, December 13, 2007 10:51 PM
Subject: [ODBC] odbc problem on Japanese windows machine


Hi,

I am trying to use postgres odbc driver on windows Japanese machine, to test connection to a
remote postgres database. The database has latin1 encoding.

Connection tests to databases with latin1 encoding fail with this error message:

fatal: conversion between SJIS and LATIN1 is not supported

Connection tests to databases with utf8 encoding succeed.

I checked both server source and odbc driver source and saw that the message comes from
postgres server code.

It seems that the postgres odbc sends SJIS characters to the latin1 database and it cannot
convert.
I know that the next command retrieves with the same error:

alter database set client_encoding="SJIS"

Is there any switch in the code to bypass local machine encoding?
Why does it send Japanese encoding?
Postgres odbc driver is not Japanese application. For what the conversion is needed?
Is there any way to overcome this problem?

Steps to reproduce error message:

1. Put postgres odbc drivers (psqlodbc30a.dll and psqlodbc35w.dll) under c:\windows\system32

2. Update machine registry with next values:
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"PostgreSQL ANSI"="Installed"
"PostgreSQL Unicode"="Installed"

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL ANSI]
"APILevel"="1"
"ConnectFunctions"="YYN"
"Driver"="c:\windows\system32\PSQLODBC30A.DLL"
"DriverODBCVer"="03.00"
"FileUsage"="0"
"Setup"=" c:\windows\system32\PSQLODBC30A.DLL"
"SQLLevel"="1"
"UsageCount"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL Unicode]
"APILevel"="1"
"ConnectFunctions"="YYN"
"Driver"=" c:\windows\system32\PSQLODBC35W.DLL"
"DriverODBCVer"="03.51"
"FileUsage"="0"
"Setup"=" c:\windows\system32\PSQLODBC35W.DLL"
"SQLLevel"="1"
"UsageCount"=dword:00000001

3. Create datasource and test connection to latin1 encoding database:
Settings -> administrative tools -> data source (ODBC)
And then add system data source with postgres driver. Configure this data source to
connect to latin1 postgres database.

Thanks,

Yuval Sofer
BMC Software
CTM&D Business Unit
DBA Team
972-52-4286-282
yuval_sofer@bmc.com



Yuval Sofer
BMC Software
CTM&D Business Unit
DBA Team
972-52-4286-282
yuval_sofer@bmc.com



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Re: odbc problem on Japanese windows machine

am 14.12.2007 09:14:42 von Hiroshi Inoue

Sofer, Yuval wrote:
> Hi,
>
> I am trying to use postgres odbc driver on windows Japanese machine, to
> test connection to a remote postgres database. The database has latin1
> encoding.
>
> Connection tests to databases with latin1 encoding fail with this error
> message:
>
> fatal: conversion between SJIS and LATIN1 is not supported

Are you testing the ANSI version driver ?
If so, please set the *Connect Settings* option like
set client_encoding to 'XXXX'
(XXXX e.g. SQL_ASCII, LATIN1 etc).

You can see the example (SJIS case) at
http://www.geocities.jp/inocchichichi/psqlodbc/encoding.jpg .

However I'm not sure if you can see LATIN1 specific characters using
Japanese machine.

regards,
Hiroshi Inoue


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Re: odbc problem on Japanese windows machine

am 16.12.2007 12:53:54 von Yuval_Sofer

Hi,=20
Thanks you very much ! you solution did it.=20
Regards=20
Yuval

-----Original Message-----
From: Hiroshi Inoue [mailto:inoue@tpf.co.jp]=20
Sent: Friday, December 14, 2007 10:15 AM
To: Sofer, Yuval
Cc: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] odbc problem on Japanese windows machine

Sofer, Yuval wrote:
> Hi,
>=20
> I am trying to use postgres odbc driver on windows Japanese machine,
to=20
> test connection to a remote postgres database. The database has latin1

> encoding.
>=20
> Connection tests to databases with latin1 encoding fail with this
error=20
> message:
>=20
> fatal: conversion between SJIS and LATIN1 is not supported

Are you testing the ANSI version driver ?
If so, please set the *Connect Settings* option like
set client_encoding to 'XXXX'
(XXXX e.g. SQL_ASCII, LATIN1 etc).

You can see the example (SJIS case) at
http://www.geocities.jp/inocchichichi/psqlodbc/encoding.jpg .

However I'm not sure if you can see LATIN1 specific characters using
Japanese machine.

regards,
Hiroshi Inoue


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match