X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7C60D3A518A; Mon, 22 Nov 2004 08:11:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21095-05; Mon, 22 Nov 2004 08:11:06 +0000 (GMT) Received: from nlr.ru (double.nlr.ru [212.193.3.3]) by svr1.postgresql.org (Postfix) with ESMTP id 9C0DE3A4234; Mon, 22 Nov 2004 08:11:06 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by nlr.ru (Postfix) with ESMTP id 12CA372C1; Mon, 22 Nov 2004 11:11:05 +0300 (MSK) Received: from nlr.ru ([127.0.0.1]) by localhost (double [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18976-02; Mon, 22 Nov 2004 11:11:00 +0300 (MSK) Received: from guryanow2 (unknown [172.16.2.2]) by nlr.ru (Postfix) with ESMTP id CFA3F7241; Mon, 22 Nov 2004 11:11:00 +0300 (MSK) Date: Mon, 22 Nov 2004 11:11:26 +0300 From: Alex Guryanow X-Mailer: The Bat! (v1.60) Organization: National Library of Russia X-Priority: 3 (Normal) Message-ID: <1591125188.20041122111126@nlr.ru> To: Tom Lane Cc: pgsq-odbc@postgresql.org, pgsql-general@postgresql.org Subject: Re: Wrong string length from unicode database in Borland's app In-Reply-To: <9235.1101063155@sss.pgh.pa.us> References: <118-60991984.20041121175609@nlr.ru> <9235.1101063155@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at nlr.ru X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/1038 X-Sequence-Number: 69118 TL> Alex Guryanow 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