Bug #445: SQLDescribeCol() returns "wrong" info

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #445: SQLDescribeCol() returns "wrong" info
Date: 2001-09-09 14:58:04
Message-ID: 200109091458.f89Ew4U23871@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jim Dickenson (dickenson(at)cfmc(dot)com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
SQLDescribeCol() returns "wrong" info

Long Description
Running PostgreSQL 7.0.3 on Red Hat Linux 7.1 system using
gcc 2.96.

When I call SQLDescribeCol() for a column that has been defined as decimal(10,3) or numeric(10,3), as an example, I would expect the values in ColumnSizePtr and DecimalDigitsPtr to be 10 and 3, not 655363 and 0. Additionally I would expect DataTypePtr to be 2 and not 12.

I need to be able to find an accurate description for the attributes
of each column returned for a select statement. It seems to me that SQLDescribeCol() should do that.

It seems to me that in order for ODBC to work with different data sources all ODBC drivers need to conform to a standard. If one driver returns one set of values and another driver returns another set of values, for what I think is the same basic table column, then the point of ODBC to be data source neutral is lost.

Sample Code
I create a table in psql. I write an application that opens the database containing the table. I call SQLPrepare with
"select * from tabname".
I call SQLDescribeCol() to get the resulting meta data.

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Karel Zak 2001-09-10 06:27:52 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Previous Message John Summerfield 2001-09-09 13:01:36 ecpg incompatibility with DB2