Thread: 08.00.0102 with UTF8 database causes client encoding mismatch error

08.00.0102 with UTF8 database causes client encoding mismatch error

From
"Andrus"
Date:
Trying to use previous version of driver with Postgres 8.1 UTF8 database
causes error

client encoding mismatch

Any idea how to fix this ?
I need to check whether one particular problem is caused by new ODBC driver
or not.

Andrus.

conn=30160408, PGAPI_DriverConnect(
in)='DRIVER={PostgreSQL};UID=postgres;PWD=x;DATABASE=eeva;SERVER=localhost;PORT=5432;B9=0;',
fDriverCompletion=1
Global Options: Version='08.00.0102', 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=0 NAMEDATALEN=64
                extra_systable_prefixes='dd_;', conn_settings=''
conn_encoding='OTHER'
conn=30160408, query=' '
conn=30160408, query='select version()'
    [ fetched 1 rows ]
    [ PostgreSQL version string = 'PostgreSQL 8.1.0 on i686-pc-mingw32,
compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)' ]
    [ PostgreSQL version number = '8.1' ]
conn=30160408, query='set DateStyle to 'ISO''
conn=30160408, query='set geqo to 'OFF''
conn=30160408, query='set extra_float_digits to 2'
conn=30160408, query='select oid from pg_type where typname='lo''
    [ fetched 0 rows ]
conn=30160408, query='select pg_client_encoding()'
    [ fetched 1 rows ]
    [ Client encoding = 'UTF8' (code = 34) ]
 Client encoding = 'UTF8' and OTHER
CONN ERROR: func=PGAPI_DriverConnect, desc='Error from CC_Connect',
errnum=214, errmsg='client encoding mismatch'
            ------------------------------------------------------------
            henv=30160352, conn=30160408, status=0, num_stmts=16
            sock=30171424, stmts=30187896, lobj_type=-999
            ---------------- Socket Info -------------------------------
            socket=460, reverse=0, errornumber=0, errormsg='(NULL)'
            buffer_in=30171496, buffer_out=30179696
            buffer_filled_in=58, buffer_filled_out=0, buffer_read_in=58



ADO-Error when inserting row with text column with large text

From
Josef Springer
Date:
Hello,<br /><br /> i am using <br /> - PostgreSQL 8.2.5<br /> - ODBC: PostgreSQL Unicode 8.02.04.0<br /><br /> When i
aminserting via the ADO-driver a row with column text with textsize about 10000, i get the ado error 0x80004005.<br />
Insertingthe same row with the SQL-editor in pgAdmin III works fine.<br /><br /> The ado details:<br /> Using
cursorLocation= adUseClient <br /> Using lockType = adLockBatchOptimistic<br /> recordset editNew ... putting column
values... recordset addNew, recordSet updateBatch (thows the ado error)<br /><br /> Has the ADO-diver any limitation
?<br/> Thanks for any help !<br /><br /> Best Regards,<br /> Josef Springer<br /><br /><br /> 

Re: ADO-Error when inserting row with text column with large text

From
Heikki Linnakangas
Date:
On 14.06.2013 10:00, Josef Springer wrote:
> Hello,
>
> i am using
> - PostgreSQL 8.2.5
> - ODBC: PostgreSQL Unicode 8.02.04.0

You seriously need to upgrade. PostgreSQL 8.2.5 was released in 2007,
and is no longer supported by the community. That ODBC version is really
old as well. There has been a lot of bug fixes and improvements in both
the server and the driver since.

I'd recommend upgrading the server immediately to the last 8.2 release,
8.2.23, as that only requires replacing the binaries. Then start
planning for a major version upgrade to PostgreSQL 9.2.

Try with the latest version of the ODBC driver, it should also work with
older server versions. I don't know if it will help with your problem,
but since you should upgrade anyway, it's worth doing that first, and
see if it happens to fix it.

- Heikki


Re: ADO-Error when inserting row with text column with large text

From
Josef Springer
Date:
Hello Heikki,<br /><br /> thanks for your quick answer !<br /> I have no possibility to update the server in the next
time.But i must work the ODBC-Insert quickly.<br /> Because inserting the row with the lage text column works in
pgAdminIII, may be the ODBC-driver is the reason. Can i update the ODBC-Driver only to make it work ?<br /><br />
Thanksfor you help !<br /><br /> Josef Springer<br /><br /> On 14.06.2013 09:57, Heikki Linnakangas wrote: <blockquote
cite="mid:51BACCEF.9010103@vmware.com"type="cite">On 14.06.2013 10:00, Josef Springer wrote: <br /><blockquote
type="cite">Hello,<br /><br /> i am using <br /> - PostgreSQL 8.2.5 <br /> - ODBC: PostgreSQL Unicode 8.02.04.0 <br
/></blockquote><br/> You seriously need to upgrade. PostgreSQL 8.2.5 was released in 2007, and is no longer supported
bythe community. That ODBC version is really old as well. There has been a lot of bug fixes and improvements in both
theserver and the driver since. <br /><br /> I'd recommend upgrading the server immediately to the last 8.2 release,
8.2.23,as that only requires replacing the binaries. Then start planning for a major version upgrade to PostgreSQL 9.2.
<br/><br /> Try with the latest version of the ODBC driver, it should also work with older server versions. I don't
knowif it will help with your problem, but since you should upgrade anyway, it's worth doing that first, and see if it
happensto fix it. <br /><br /> - Heikki <br /><br /><br /></blockquote><br /><div class="moz-signature"><br /></div> 

Re: ADO-Error when inserting row with text column with large text

From
Heikki Linnakangas
Date:
On 14.06.2013 16:28, Josef Springer wrote:
> Can i update the ODBC-Driver only to make it work ?

Yeah, it's worth a try...

- Heikki


Re: ADO-Error when inserting row with text column with large text

From
Hiroshi Inoue
Date:
Hi Josef,

(2013/06/14 16:00), Josef Springer wrote:
> Hello,
>
> i am using
> - PostgreSQL 8.2.5
> - ODBC: PostgreSQL Unicode 8.02.04.0
>
> When i am inserting via the ADO-driver a row with column text with
> textsize about 10000, i get the ado error 0x80004005.
> Inserting the same row with the SQL-editor in pgAdmin III works fine.
>
> The ado details:
> Using cursorLocation = adUseClient
> Using lockType = adLockBatchOptimistic
> recordset editNew ... putting column values ... recordset addNew,
> recordSet updateBatch (thows the ado error)
>
> Has the ADO-diver any limitation ?
> Thanks for any help !

Please try to increase *MaxLongVarcharSize*.

regards,
Hiroshi Inoue



Re: ADO-Error when inserting row with text column with large text

From
Josef Springer
Date:
Hi Hiroshi,<br /><br /> thanks for your hint. <br /> But where to change *MaxLongVarcharSize* ?<br /> I open the
recordsetwith <br /><i>Open( "select * from table", activeConnection: "Driver={PostgreSQL
Unicode};Server=localhost;Uid=<uid>;Pwd=<pwd>;Database=<database>")</i><br /> I do not know where to
givethis option. In an ODBC-Setting, there ist the possibility to define *MaxLongVarcharSize*, but i am using the
driverby gibving its systemname.<br /><br /> Thanks for your hints !<br /><br /> Josef Springer<br /><br /> On
14.06.201316:07, Hiroshi Inoue wrote: <blockquote cite="mid:51BB23B1.2030905@tpf.co.jp" type="cite">Hi Josef, <br /><br
/>(2013/06/14 16:00), Josef Springer wrote: <br /><blockquote type="cite">Hello, <br /><br /> i am using <br /> -
PostgreSQL8.2.5 <br /> - ODBC: PostgreSQL Unicode 8.02.04.0 <br /><br /> When i am inserting via the ADO-driver a row
withcolumn text with <br /> textsize about 10000, i get the ado error 0x80004005. <br /> Inserting the same row with
theSQL-editor in pgAdmin III works fine. <br /><br /> The ado details: <br /> Using cursorLocation = adUseClient <br />
UsinglockType = adLockBatchOptimistic <br /> recordset editNew ... putting column values ... recordset addNew, <br />
recordSetupdateBatch (thows the ado error) <br /><br /> Has the ADO-diver any limitation ? <br /> Thanks for any help !
<br/></blockquote><br /> Please try to increase *MaxLongVarcharSize*. <br /><br /> regards, <br /> Hiroshi Inoue <br
/><br/><br /><br /></blockquote><br /><div class="moz-signature"><br /></div> 

Re: ADO-Error when inserting row with text column with large text

From
Hiroshi Inoue
Date:
(2013/06/14 23:49), Josef Springer wrote:
> Hi Hiroshi,
>
> thanks for your hint.
> But where to change *MaxLongVarcharSize* ?
> I open the recordset with
> /Open( "select * from table", activeConnection: "Driver={PostgreSQL
> Unicode};Server=localhost;Uid=<uid>;Pwd=<pwd>;Database=<database>" )/

Add  ;MaxVarcharSize=xxxxxx  to your connection string.
The default is 8190.

> I do not know where to give this option. In an ODBC-Setting, there ist
> the possibility to define *MaxLongVarcharSize*, but i am using the
> driver by gibving its systemname.

regards,
Hiroshi Inoue



Re: ADO-Error when inserting row with text column with large text

From
Hiroshi Inoue
Date:
(2013/06/15 0:13), Hiroshi Inoue wrote:
> (2013/06/14 23:49), Josef Springer wrote:
>> Hi Hiroshi,
>>
>> thanks for your hint.
>> But where to change *MaxLongVarcharSize* ?
>> I open the recordset with
>> /Open( "select * from table", activeConnection: "Driver={PostgreSQL
>> Unicode};Server=localhost;Uid=<uid>;Pwd=<pwd>;Database=<database>" )/
>
> Add  ;MaxVarcharSize=xxxxxx  to your connection string.
> The default is 8190.

Please also try to add
   TextAsLongVarchar=1
option to your connection string.

regards,
Hiroshi Inoue



Re: ADO-Error when inserting row with text column with large text

From
Josef Springer
Date:
Hello Hiroshi,<br /><br /> much thanks to you !!!!!!!<br /> Adding <i>MaxLongVarcharSize=<nnn> </i>and
<i>TextAsLongVarchar=1</i>to the connection string works perfect !<br /><p>mit freundlichen Grüßen / best regards,<br
/>Josef Springer<br /> (Geschäftsleitung/Management)<table border="0" cellpadding="0" cellspacing="0"
width="75%"><tbody><tr><td><imgalt="Postal" height="16" src="cid:part1.03080603.09050509@joops.com" vspace="2"
width="17"/><br /></td><td valign="top"><font color="#cc0000">Address</font><br /></td><td valign="top"><font
color="#000099"><u><aclass="moz-txt-link-abbreviated"
href="mailto:Josef.Springer@joops.com">Josef.Springer@joops.com</a></u></font><fontcolor="#cc0000"><br
/></font></td><tdnowrap valign="top">Orlando-di-Lasso Str. 2<br /></td><td nowrap valign="top">D-85640 Putzbrunn<br
/></td></tr><tr><tdnowrap valign="top"><img alt="Phone" height="15" src="cid:part2.09010006.04050409@joops.com"
vspace="2"width="13" /><br /></td><td nowrap valign="top"><font color="#cc0000">Office</font><font color="#000099"><br
/></font></td><tdnowrap valign="top"><font color="#000099">+49 (0)89 600 6920</font><br /></td><td nowrap
valign="top"><br/></td><td valign="top"><br /></td></tr><tr><td valign="top"><img alt="Phone" height="15"
src="cid:part2.09010006.04050409@joops.com"vspace="2" width="13" /></td><td valign="top"><font
color="#cc0000">Fax</font><fontcolor="#000099"><br /></font></td><td valign="top"><font color="#000099">+49 (0)89 600
69220</font><br/></td><td valign="top"><br /></td><td valign="top"><br /></td></tr><tr><td valign="top"><img alt="Web"
height="15"src="cid:part4.02070602.08070302@joops.com" vspace="2" width="15" /><br /></td><td valign="top"><font
color="#cc0000">Web</font><fontcolor="#000099"><br /></font></td><td valign="top"><font color="#000099"><a
class="moz-txt-link-freetext"href="http://www.joops.com">http://www.joops.com</a></font><br /></td><td valign="top"><br
/></td><tdvalign="top"><br /></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0"
width="50%"><tbody><tr><tdvalign="top"><img align="left" alt="JOOPS" height="61" hspace="0"
src="cid:part5.08000601.09060802@joops.com"width="220" /><br /></td><td nowrap valign="bottom">(HRB München 86239)<br
/><br/><b>-- the software company --</b></td></tr></tbody></table><br /> On 15.06.2013 00:01, Hiroshi Inoue wrote:
<blockquotecite="mid:51BB92A5.8060305@tpf.co.jp" type="cite">(2013/06/15 0:13), Hiroshi Inoue wrote: <br /><blockquote
type="cite">(2013/06/1423:49), Josef Springer wrote: <br /><blockquote type="cite">Hi Hiroshi, <br /><br /> thanks for
yourhint. <br /> But where to change *MaxLongVarcharSize* ? <br /> I open the recordset with <br /> /Open( "select *
fromtable", activeConnection: "Driver={PostgreSQL <br />
Unicode};Server=localhost;Uid=<uid>;Pwd=<pwd>;Database=<database>")/ <br /></blockquote><br /> Add 
;MaxVarcharSize=xxxxxx to your connection string. <br /> The default is 8190. <br /></blockquote><br /> Please also try
toadd <br />   TextAsLongVarchar=1 <br /> option to your connection string. <br /><br /> regards, <br /> Hiroshi Inoue
<br/><br /><br /><br /></blockquote><br /><div class="moz-signature"><br /></div>