Обсуждение: 08.00.0102 with UTF8 database causes client encoding mismatch error

Поиск
Список
Период
Сортировка

08.00.0102 with UTF8 database causes client encoding mismatch error

От
"Andrus"
Дата:
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

От
Josef Springer
Дата:
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

От
Heikki Linnakangas
Дата:
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

От
Josef Springer
Дата:
Hello Heikki,

thanks for your quick answer !
I have no possibility to update the server in the next time. But i must work the ODBC-Insert quickly.
Because inserting the row with the lage text column works in pgAdmin III, may be the ODBC-driver is the reason. Can i update the ODBC-Driver only to make it work ?

Thanks for you help !

Josef Springer

On 14.06.2013 09:57, Heikki Linnakangas wrote:
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

От
Heikki Linnakangas
Дата:
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

От
Hiroshi Inoue
Дата:
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

От
Josef Springer
Дата:
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>" )
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.

Thanks for your hints !

Josef Springer

On 14.06.2013 16:07, Hiroshi Inoue wrote:
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

От
Hiroshi Inoue
Дата:
(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

От
Hiroshi Inoue
Дата:
(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

От
Josef Springer
Дата:
Hello Hiroshi,

much thanks to you !!!!!!!
Adding MaxLongVarcharSize=<nnn> and TextAsLongVarchar=1 to the connection string works perfect !

mit freundlichen Grüßen / best regards,
Josef Springer
(Geschäftsleitung/Management)

Postal
Address
Josef.Springer@joops.com
Orlando-di-Lasso Str. 2
D-85640 Putzbrunn
Phone
Office
+49 (0)89 600 6920


PhoneFax
+49 (0)89 600 69220


Web
Web
http://www.joops.com


JOOPS
(HRB München 86239)

-- the software company --

On 15.06.2013 00:01, Hiroshi Inoue wrote:
(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