pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Guryanow <gav@nlr.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsq-odbc@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: Wrong string length from unicode database in Borland's app
Date: Mon, 22 Nov 2004 11:11:26 +0300
Message-ID: <1591125188.20041122111126@nlr.ru> (raw)
In-Reply-To: <9235.1101063155@sss.pgh.pa.us>
References: <118-60991984.20041121175609@nlr.ru>
	<9235.1101063155@sss.pgh.pa.us>

TL> Alex Guryanow <gav@nlr.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


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


>> 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




view thread (7+ messages)  latest in thread

Message-ID: <1591125188.20041122111126@nlr.ru>
Permalink:  ../1591125188.20041122111126@nlr.ru/
Also on:    postgresql.org/message-id/1591125188.20041122111126@nlr.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: gav@nlr.ru, tgl@sss.pgh.pa.us, pgsq-odbc@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: Wrong string length from unicode database in Borland's app
  In-Reply-To: <1591125188.20041122111126@nlr.ru>
  References: <118-60991984.20041121175609@nlr.ru> <9235.1101063155@sss.pgh.pa.us> <1591125188.20041122111126@nlr.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox