dbTalk Databases Forums  

Re: [GENERAL] Wrong string length from unicode database in Borland's app

comp.databases.postgresql.interfaces.odbc comp.databases.postgresql.interfaces.odbc


Discuss Re: [GENERAL] Wrong string length from unicode database in Borland's app in the comp.databases.postgresql.interfaces.odbc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alex Guryanow
 
Posts: n/a

Default Re: [GENERAL] Wrong string length from unicode database in Borland's app - 11-22-2004 , 02:19 AM






TL> Alex Guryanow <gav (AT) nlr (DOT) ru> writes:
Quote:
When pg-server is version 7.1.3 windows app works fine, but when
pg-server is version 7.4.6 or 8.0beta4 under certain conditions the
app receives strings with wrong lengths.
TL> Are both servers set up with the same database encoding?

I think the answer is yes. For both servers the command "initdb" was
executed only with parameter DATADIR. At the same time the locale is
set up to "ru_RU.cp1251".

But by creating the database I specify parameter "-E UNICODE" and
"psql -l" shows that the database is in UNICODE encoding. One
time I have forgotten to specify '-E UNICODE' by executing createdb
and windows app worked fine with 7.4.6


TL> (Is the 7.1
TL> server even compiled to support non-ASCII encodings?)

Here is the fragment of config.status from 7.1.3 source directory

../configure --prefix=/db/pgsql-713 --enable-locale --enable-multibyte --with-perl


Quote:
But by executing the query
select volume, trim(number) from issue where mag_id = 25403;
the datagrid component (that displays query's results) contains in
second column values with length of 32769.
TL> If you try the same query in plain psql, what do you get?

I get all ok. For example, the query

select volume, length( trim( number ) ) from issue where mag_id = 25403;

shows in second column values from 5 to 7

TL> What is in
TL> the wrong-length value, exactly?

'N 1-2'

The appropriate "volume" column contains 'Evf. 120' where 'E' is 'E
with ascent' (I don't know how to write them in this letter). pg_dump
writes the following sequence of bytes (in hex-format) for this value:

C3 89 76 66 2E 20 31 32 30

and 'N 1-2' is

4E 20 31 2D 32


Best regards,
Alex


TL> regards, tom lane


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



Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [GENERAL] Wrong string length from unicode database in Borland's app - 11-22-2004 , 09:52 AM






Alex Guryanow <gav (AT) nlr (DOT) ru> writes:
Quote:
When pg-server is version 7.1.3 windows app works fine, but when
pg-server is version 7.4.6 or 8.0beta4 under certain conditions the
app receives strings with wrong lengths.

TL> If you try the same query in plain psql, what do you get?

I get all ok.
In that case it would seem to be an ODBC driver issue. Unfortunately it
looks like you mistyped the pgsql-odbc mailing list address; I'd suggest
reposting the details over there.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #3  
Old   
Merlin Moncure
 
Posts: n/a

Default Re: [GENERAL] Wrong string length from unicode database in Borland's app - 11-23-2004 , 02:55 PM



Quote:
TL> Alex Guryanow <gav (AT) nlr (DOT) ru> writes:
When pg-server is version 7.1.3 windows app works fine, but when
pg-server is version 7.4.6 or 8.0beta4 under certain conditions the
app receives strings with wrong lengths.

TL> Are both servers set up with the same database encoding?

I think the answer is yes. For both servers the command "initdb" was
executed only with parameter DATADIR. At the same time the locale is
set up to "ru_RU.cp1251".

But by creating the database I specify parameter "-E UNICODE" and
"psql -l" shows that the database is in UNICODE encoding. One
time I have forgotten to specify '-E UNICODE' by executing createdb
and windows app worked fine with 7.4.6
Alex, if you are using C++ builder and postgresql you should consider
using the Zeos database connection components for PostgreSQL. They are
lightweight, fast, and fairly well supported.

Merlin

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.