From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Christoph Berg <christoph.berg@credativ.de>
Cc: PostgreSQL ODBC <pgsql-odbc@postgresql.org>
Cc: psqlodbc@packages.debian.org
Subject: Re: 09.03.0100 cursor failures on various architectures
Date: Sun, 02 Mar 2014 13:54:34 +0900
Message-ID: <5312B98A.90901@tpf.co.jp> (raw)
In-Reply-To: <53105C83.9090605@vmware.com>
References: <20140212104524.GA4409@msgid.credativ.de>
<52FE1220.9050205@vmware.com>
<530C177F.2030906@tpf.co.jp>
<530C78F7.5050304@vmware.com>
<530CB308.6030507@tpf.co.jp>
<530CCB30.8090606@vmware.com>
<530D4139.7090707@tpf.co.jp>
<530DAB26.9000907@vmware.com>
<530F21F1.6000406@tpf.co.jp>
<53105C83.9090605@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
(2014/02/28 18:53), Heikki Linnakangas wrote:
> On 02/27/2014 01:30 PM, Hiroshi Inoue wrote:
>> (2014/02/26 17:51), Heikki Linnakangas wrote:
>>> It works on Windows, because sizeof(long) == sizeof(SQLINTEGER) on
>>> Windows, and it works with unixODBC because unixODBC defines SQL_C_LONG
>>> as 32-bits regardless of the actual width of "long".
>>
>> The ODBC spec clearly mentiones that SQL_C_LONG corresponds to
>> SQLINTEGER from the first.
>
> It also clearly says that the native C type corresponding SQL_C_LONG and
> SQL_INTEGER is "long".
It's foramtive as you taught me about SQLINTEGER in SQL/CLI.
Microsoft gave an example which can be used in their working
16-bit OSs and comimg 32-bit OSs.
Please note that at that time neither SQL/CLI nor ODBC guaranteed
that the spec would be valid under 64-bit paltforms.
It was not so long ago the spec of 64-bit ODBC was determined.
>> Though you emphasize ODBC is a superset, ODBC was not a superset
>> of sql/cli from the first. In the first place SQL/CLI didn't exist
>> when ODBC was introduced. Of cource SQL_C_XXXX was not an extension
>> of sql/cli spec then. You can't find SQL_C_XXXX because SQL_C_XXXX
>> is a C-specific concept and maybe sql/cli shrinked the spec so as
>> to avoid language-specific concept. As a result the spec uses the
>> same notations SQL_xxxx for different kind of concepts. ODBC uses
>> different notations for different kind of concepts.
>
> Yeah.
>
>> Which do you prefer?
>
> I would recommend applications to not use SQL_C_xxx type codes. I would
> recommend using a SQLINTEGER variable with SQL_INTEGER type code. That's
> the most readable, and most portable option.
> (I actually like the idea of separate SQL_C_xxx type codes, to refer to
> the native types.
Unfortunately such a use is inappropriate in database programing.
For example I can find the following in SQL/CLI spec.
2.2.2 Data type for C
For binary compatibility of object modules, applications must use
symbolic data types defined ...
It's very important and you are saying the opposite of SQL/CLI
recommendation from the first.
What you have to discuss with is the Open Group not unixODBC.
>> Now I'm examining what SQLINTEGER means in SQL/CLI spec though
>> it may be an old one.
>> Hmmm, could you please tell me SQLINTEGER is a 32-bit integer,
>> 64-bit one or platform-dependent one on 64-bit platforms?
>> I find a line
>> SQLINTEGER long Length of buffers for column data and ...
>> Is it right in the latest spec?
>
> Hmm, I don't see that line in my copy. But it does include a sample
> sqlcli.h header file that has this in Annex H:
>
> typedef long SQLINTEGER;
> typedef long long SQLBIGINT;
>
> That probably assumes that "long" is 32-bits wide.
It's very important whether SQLINTEGER means 32-bit or 64-bit
in 64-bit platforms. If SQLINTEGER means 64-bit integers in
SQL/CLI, I have to tell members of this list not to use it.
> The Annex has been
> marked as "informative", so it's only meant as an example, though.
Yes it's formative. And so is for ODBC. As you emphasized many times
ODBC became a superset of SQL/CLI conseqently.
regards,
Hiroshi Inoue
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
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: inoue@tpf.co.jp, hlinnakangas@vmware.com, christoph.berg@credativ.de, psqlodbc@packages.debian.org
Subject: Re: 09.03.0100 cursor failures on various architectures
In-Reply-To: <5312B98A.90901@tpf.co.jp>
References: <20140212104524.GA4409@msgid.credativ.de> <52FE1220.9050205@vmware.com> <530C177F.2030906@tpf.co.jp> <530C78F7.5050304@vmware.com> <530CB308.6030507@tpf.co.jp> <530CCB30.8090606@vmware.com> <530D4139.7090707@tpf.co.jp> <530DAB26.9000907@vmware.com> <530F21F1.6000406@tpf.co.jp> <53105C83.9090605@vmware.com> <5312B98A.90901@tpf.co.jp>
* 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