From: Clemens Ladisch <clemens@ladisch.de>
To: pgsql-odbc@lists.postgresql.org
Subject: Re: Reported lengths of char fields - psqlODBC
Date: Sat, 9 Feb 2019 08:57:18 +0100
Message-ID: <703d9962-2e04-83ab-3a36-8988dd2cc8d7@ladisch.de> (raw)
In-Reply-To: <CAHbe0hH-degRJXD2tmNCoA1RBrVJGLKj_U7udB04uJYGx1-mbQ@mail.gmail.com>
References: <CAHbe0hH-degRJXD2tmNCoA1RBrVJGLKj_U7udB04uJYGx1-mbQ@mail.gmail.com>
Bob Brodd wrote:
> Postgresql v 9.5.14
> psqlODBC v1:09.03.0300-1
Please note that newer versions of the ODBC driver are backwards compatible,
and have bug fixes.
> I created a simple table containing one column of type character (n).
> When I ask for the width of the column via (ODBC)SQLColAttribute function,
> it answers (n*6)
I guess you are asking not for SQL_DESC_LENGTH but SQL_DESC_OCTET_LENGTH?
The latter multiplies the column size (in characters) by the maximum possible
number of bytes per character, which is 4 in the Unicode driver, and 6 when
using UTF-8 as client encoding. (In driver version 9.6.3, the UTF-8 value
was corrected to 4.)
Regards,
Clemens
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: clemens@ladisch.de
Subject: Re: Reported lengths of char fields - psqlODBC
In-Reply-To: <703d9962-2e04-83ab-3a36-8988dd2cc8d7@ladisch.de>
References: <CAHbe0hH-degRJXD2tmNCoA1RBrVJGLKj_U7udB04uJYGx1-mbQ@mail.gmail.com> <703d9962-2e04-83ab-3a36-8988dd2cc8d7@ladisch.de>
* 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