Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

I created a table via:

CREATE TABLE publisher
  name character varying(80) NOT NULL,
  address text,
  CONSTRAINT publisher_pkey PRIMARY KEY (name)
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:

                        Statement = 0x83f2820
                        SQL = [SELECT Name FROM Publisher][length = 26
                        Statement = 0x83f2820
                        Column Number = 1
                        Target Type = -8 SQL_WCHAR
                        Target Value = 0xbfd29a4c
                        Buffer Length = 1024
                        StrLen Or Ind = 0xbfd29e54
                        Statement = 0x83f2820
                DIAG [07006] Received an unsupported type from Postgres

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

                        Connection = 0x83eac28
                        Server Name = [LiLiDaB (local PG)][length = 18
                        User Name = [postgres][length = 8 (SQL_NTS)]
                        Authentication = [******][length = 6 (SQL_NTS)]
                UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group