X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 80AFC3A4CBF for ; Sun, 21 Nov 2004 15:04:43 +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 72326-10 for ; Sun, 21 Nov 2004 15:04:33 +0000 (GMT) Received: from nlr.ru (double.nlr.ru [212.193.3.3]) by svr1.postgresql.org (Postfix) with ESMTP id C687F3A4C99 for ; Sun, 21 Nov 2004 15:04:36 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by nlr.ru (Postfix) with ESMTP id 46F1D722E for ; Sun, 21 Nov 2004 18:04:37 +0300 (MSK) Received: from nlr.ru ([127.0.0.1]) by localhost (double [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17393-05 for ; Sun, 21 Nov 2004 18:04:33 +0300 (MSK) Received: from guryanow2 (unknown [172.16.2.2]) by nlr.ru (Postfix) with ESMTP id 004167145 for ; Sun, 21 Nov 2004 18:04:33 +0300 (MSK) Date: Sun, 21 Nov 2004 18:04:59 +0300 From: Alex Guryanow X-Mailer: The Bat! (v1.60) Organization: National Library of Russia X-Priority: 3 (Normal) Message-ID: <185-60462281.20041121180459@nlr.ru> To: pgsql-odbc@postgresql.org Subject: Wrong string length from unicode database in Borland's app Resent-From: Alex Guryanow MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-Id: <20041121150433.004167145@nlr.ru> Resent-Date: Sun, 21 Nov 2004 18:04:33 +0300 (MSK) 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/96 X-Sequence-Number: 4710 Hi, I have windows app written in Borland C++ Builder 5.0. Using ODBC driver windows app connects to database on linux server. Database is created with UNICODE encoding. 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. For example: the database contains table "issue" with the following structure: Column | Type | Modifiers -----------+--------------------------+--------------- id | integer | not null ... mag_id | integer | year | character(36) | volume | character(78) | number | character(300) | user_name | character(20) | default getpgusername() mod_date | timestamp with time zone | default now() Only the column "volume" can contain unicode symbols. When the the windows application executes the following query: select year, trim(number) from issue where mag_id = 25403; all works fine. 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. Those big values are only in rows where appropriate "volume" field contains unicode symbols. Actually all values in column "number" are 5-7 symbols long. By executing the query select year, number from issue where mag_id = 25403; all works fine. I have checked several versions of ODBC-driver: 07.03.0200, 07.05.0001, 08.00.0002 - the effects are the same: all works fine with postgres-server 7.1.3 and works bad with 7.4.6 or 8.0beta4 Changing of driver settings (as described on http://gborg.postgresql.org/project/psqlodbc/faq/faq.php in "Borland Apps" section) does not help too. My setup is: Parse Statements - checked Unknown Sizes - Longest Text as LongVarChar - checked Unknowns as LongVarChar - unchecked Without those settings the windows app works even worse. Please help me to solve this problem. May be I'm doing something wrong? May be my windows is set up incorrectly? (I'm using Win2K SP4) Or is this a ODBC-driver's bug? Or server's? Or may be it's a Borlands BDE error? Has somebody used windows app written in borland to connect to unicode table under postgresql > 7.1.3 ? Best regards, Alex