BUG #3030: Unable to query SQL_WCHAR column via ODBC

From: "Dr(dot) Axel Reimann" <axel(dot)privat(at)web(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3030: Unable to query SQL_WCHAR column via ODBC
Date: 2007-02-19 13:43:18
Message-ID: 200702191343.l1JDhI0g024894@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3030
Logged by: Dr. Axel Reimann
Email address: axel(dot)privat(at)web(dot)de
PostgreSQL version: 8.1.8
Operating system: Gentoo Linux, Kernel 2.6.19, glibc 2.5
Description: Unable to query SQL_WCHAR column via ODBC
Details:

I created a table via:

CREATE TABLE publisher
(
name character varying(80) NOT NULL,
address text,
CONSTRAINT publisher_pkey PRIMARY KEY (name)
)
WITHOUT OIDS;
ALTER TABLE publisher OWNER TO postgres;

whereas the database encoding is set to UTF8 and
inserted some data, lets say:
'New Publisher' 'new address'

If I query that table, e.g. via pgAdmin's query tool,
I can easily retrieve the entered information.
Running a corresponding query from an ODBC application,
I get the following 'unsupported type' error:

[ODBC][11736][SQLExecDirectW.c][138]
Entry:
Statement = 0x83f2820
SQL = [SELECT Name FROM Publisher][length = 26
(SQL_NTS)]
[ODBC][11736][SQLExecDirectW.c][396]
Exit:[SQL_SUCCESS]
[ODBC][11736][SQLBindCol.c][222]
Entry:
Statement = 0x83f2820
Column Number = 1
Target Type = -8 SQL_WCHAR
Target Value = 0xbfd29a4c
Buffer Length = 1024
StrLen Or Ind = 0xbfd29e54
[ODBC][11736][SQLBindCol.c][326]
Exit:[SQL_SUCCESS]
[ODBC][11736][SQLFetch.c][158]
Entry:
Statement = 0x83f2820
[ODBC][11736][SQLFetch.c][340]
Exit:[SQL_ERROR]
DIAG [07006] Received an unsupported type from Postgres

The connection was made via ODBC's SQLConnectW function
and returned:

[ODBC][11609][SQLConnectW.c][159]
Entry:
Connection = 0x83eac28
Server Name = [LiLiDaB (local PG)][length = 18
(SQL_NTS)]
User Name = [postgres][length = 8 (SQL_NTS)]
Authentication = [******][length = 6 (SQL_NTS)]
UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE
'UCS-2LE'

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2007-02-19 17:44:28 Re: [BUGS] BUG #2977: dow doesn't conform to ISO-8601
Previous Message Pelle Johansson 2007-02-19 09:13:35 Re: BUG #3012: Wrong JOIN order when a JOIN depends on result from a LEFT JOIN.