Thread: client encoding mismatch

client encoding mismatch

From
Andrey Repko
Date:
Hello all,

conn=16530880, PGAPI_DriverConnect( in)='DSN=dep2_try;', fDriverCompletion=0
DSN info: DSN='dep2_try',server='127.0.0.1',port='5544',dbase='template1',user='postgres',passwd='xxxxx'
          onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
          conn_settings='',conn_encoding='OTHER'
          translation_dll='',translation_option=''
Global Options: Version='08.01.0004', fetch=100, socket=8192, unknown_sizes=0, max_varchar_size=254,
max_longvarchar_size=8190
                disable_optimizer=1, ksqo=1, unique_index=1, use_declarefetch=0
                text_as_longvarchar=1, unknowns_as_longvarchar=0, bools_as_char=1 NAMEDATALEN=64
                extra_systable_prefixes='dd_;', conn_settings='' conn_encoding='OTHER'
conn=16530880, query='select version()'
    [ PostgreSQL version string = 'PostgreSQL 8.1beta2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2
(mingw-special)'] 
    [ PostgreSQL version number = '8.1' ]
conn=16530880, query='set DateStyle to 'ISO''
conn=16530880, query='set geqo to 'OFF''
conn=16530880, query='set extra_float_digits to 2'
conn=16530880, query='select oid from pg_type where typname='lo''
    [ Large Object oid = 16609 ]
conn=16530880, query='select pg_client_encoding()'
    [ Client encoding = 'WIN1251' (code = 22) ]
 Client encoding = 'WIN1251' and WIN
CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect', errnum=214, errmsg='client encoding mismatch'
            ------------------------------------------------------------
            henv=16530824, conn=16530880, status=0, num_stmts=16

 Maybe this information can be helpful:

 Run at PG 8.1
 -----------
 select pg_client_encoding();
 result = WIN1251
 --------------
 Run at PG 8.0
 -----------
 select pg_client_encoding();
 result = WIN
 --------------

 Subj error occur only on PG 8.1, not 8.0.

 At whatnew:
E.1.3.7. Encoding and Locale Changes

Rename some encodings to be more consistent and to follow international standards (Bruce)
 UNICODE is now UTF8
 ALT is now WIN866
 WIN is now WIN1251
 TCVN is now WIN1258

http://developer.postgresql.org/docs/postgres/release.html#RELEASE-8-1


--
С наилучшими пожеланиями,
  Репко Андрей Владимирович       mailto:repko@sart.must-ipra.com


Re: client encoding mismatch

From
"Hiroshi Saito"
Date:
Hi Andrey.

This may not be good management. However, Some problems will be solved.
This is correspondence only by the Multibyte. I desire proper evaluation by Dave.

Regards,
Hiroshi Saito

From: "Andrey Repko"


> Hello all,
>
> conn=16530880, PGAPI_DriverConnect( in)='DSN=dep2_try;', fDriverCompletion=0
> DSN info:
DSN='dep2_try',server='127.0.0.1',port='5544',dbase='template1',user='postgres',passwd='xx
xxx'
>           onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
>           conn_settings='',conn_encoding='OTHER'
>           translation_dll='',translation_option=''
> Global Options: Version='08.01.0004', fetch=100, socket=8192, unknown_sizes=0,
max_varchar_size=254, max_longvarchar_size=8190
>                 disable_optimizer=1, ksqo=1, unique_index=1, use_declarefetch=0
>                 text_as_longvarchar=1, unknowns_as_longvarchar=0, bools_as_char=1
NAMEDATALEN=64
>                 extra_systable_prefixes='dd_;', conn_settings='' conn_encoding='OTHER'
> conn=16530880, query='select version()'
>     [ PostgreSQL version string = 'PostgreSQL 8.1beta2 on i686-pc-mingw32, compiled by
GCC gcc.exe (GCC) 3.4.2 (mingw-special)' ]
>     [ PostgreSQL version number = '8.1' ]
> conn=16530880, query='set DateStyle to 'ISO''
> conn=16530880, query='set geqo to 'OFF''
> conn=16530880, query='set extra_float_digits to 2'
> conn=16530880, query='select oid from pg_type where typname='lo''
>     [ Large Object oid = 16609 ]
> conn=16530880, query='select pg_client_encoding()'
>     [ Client encoding = 'WIN1251' (code = 22) ]
>  Client encoding = 'WIN1251' and WIN
> CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect', errnum=214,
errmsg='client encoding mismatch'
>             ------------------------------------------------------------
>             henv=16530824, conn=16530880, status=0, num_stmts=16
>
>  Maybe this information can be helpful:
>
>  Run at PG 8.1
>  -----------
>  select pg_client_encoding();
>  result = WIN1251
>  --------------
>  Run at PG 8.0
>  -----------
>  select pg_client_encoding();
>  result = WIN
>  --------------
>
>  Subj error occur only on PG 8.1, not 8.0.
>
>  At whatnew:
> E.1.3.7. Encoding and Locale Changes
>
> Rename some encodings to be more consistent and to follow international standards
(Bruce)
>  UNICODE is now UTF8
>  ALT is now WIN866
>  WIN is now WIN1251
>  TCVN is now WIN1258
>
> http://developer.postgresql.org/docs/postgres/release.html#RELEASE-8-1
>

Attachment

Re: client encoding mismatch

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Hiroshi Saito
> Sent: 20 September 2005 07:51
> To: ?????? ?????
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] client encoding mismatch
>
> Hi Andrey.
>
> This may not be good management. However, Some problems will
> be solved.
> This is correspondence only by the Multibyte. I desire proper
> evaluation by Dave.

Looks good to me - anyone who knows more than me about this sort of
thing want to comment?

/D

Re: client encoding mismatch

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Hiroshi Saito
> Sent: 20 September 2005 07:51
> To: ?????? ?????
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] client encoding mismatch
>
> Hi Andrey.
>
> This may not be good management. However, Some problems will
> be solved.
> This is correspondence only by the Multibyte. I desire proper
> evaluation by Dave.

Thanks Hiroshi - patch applied.

Andrey, do you want me to mail you a DLL to test?

Regards, Dave.

Re: client encoding mismatch

From
"Dave Page"
Date:

> -----Original Message-----
> From: Андрей Репко [mailto:repko@sart.must-ipra.com]
> Sent: 22 September 2005 11:41
> To: Dave Page
> Subject: Re[4]: [ODBC] client encoding mismatch
>
> Hello Dave,
>
> Thursday, September 22, 2005, 1:01:40 PM, Вы писали:
>
>
> The same result :(
> And when I set Advanced Options -> connect set to
> 'conn_encoding="WIN1251"' in log file I see the next:
>
> Global Options: Version='08.01.0005', fetch=100, socket=0,
> unknown_sizes=254, max_varchar_size=8190,
> max_longvarchar_size=20725080
>                 disable_optimizer=1, ksqo=1, unique_index=1,
> use_declarefetch=0
>                 text_as_longvarchar=1,
> unknowns_as_longvarchar=0, bools_as_char=1 NAMEDATALEN=64
>                 extra_systable_prefixes='dd_;',
> conn_settings='' conn_encoding='WIN'
>

Hmm, how odd. It works for me. I assume you are using the ANSI driver?

Hiroshi - can you use win1251 with your patch?

Regards, Dave

Re: client encoding mismatch

From
"Hiroshi Saito"
Date:
Hi.

I tell that it is satisfactory.

[3624]PDATA_free_params:  ENTER, self=186673392
[3624]**** PGAPI_ExecDirect: hstmt=186672968, statement='set client_encoding to 'WIN1251''
[3624]PGAPI_ExecDirect: calling PGAPI_Execute...
[3624]PGAPI_Execute: entering...
[3624]PGAPI_Execute: clear errors...
[3624]recycle statement: self= 186672968
[3624]PDATA_free_params:  ENTER, self=186673392
[3624]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=32,
stmt='set client_encoding to 'WIN1251''
[3624]   stmt_with_params = 'set client_encoding to 'WIN1251''
[3624]      it's NOT a select statement: stmt=186672968
[3624]send_query(): conn=186661696, query='set client_encoding to 'WIN1251''
[3624]in QR_Constructor
[3624]exit QR_Constructor
[3624]the server returned the error: ERROR:  conversion between WIN1251 and EUC_JP is not
supported
[3624]send_query: done sending query
[3624]QR_fetch_tuples: cursor = '', self->cursor=0

> > conn_settings='' conn_encoding='WIN'
> >
>
> Hmm, how odd. It works for me. I assume you are using the ANSI driver?
>
> Hiroshi - can you use win1251 with your patch?
>

Please carry out by the method of not setting option.

Regards,
Horoshi Saito



Re: client encoding mismatch

From
"Hiroshi Saito"
Date:
Hi Андрей.

Sorry. I understood the problem.
Please check it Dave.
Thank you.

Regards,
Hiroshi Saito

> Hm, may be I do something wrong :(
> But.
>  1. initdb was run with locale C and DB encoding WIN1251.
>  2. I setup new .msi from Dave v. 08.01.0005.
>  3. psql -> CREATE DATABASE db_1 ENCODING 'win1251';
>  4. Add datasource "PostgreSQL ANSI", without any changes of settings
>  (only all logs on) named db_1
>  5. Create empty .udl file, select db_1 and just press Test
>  connection.
>  6. Get Error that finished by 'client encoding mismatch';
>  :(
> To files with full logs attached.
>
> >> > Hiroshi - can you use win1251 with your patch?
> >>
>
> HS> Please carry out by the method of not setting option.

Attachment

Re: client encoding mismatch

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Hiroshi Saito
> Sent: 22 September 2005 16:22
> To: Андрей Репко
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] client encoding mismatch
>
> Hi Андрей.
>
> Sorry. I understood the problem.
> Please check it Dave.
> Thank you.

Thanks Hiroshi- patch applied. Do you want another update Andrey?

Regards, Dave