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

Re: Problem with SQLGetTypeInfo

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: zh_ok(at)163(dot)net
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Problem with SQLGetTypeInfo
Date: 2002-07-05 01:17:33
Message-ID: 3D24F3AD.4AA20A87@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-odbc
> Zhou Han wrote:
> 
> There's a missmatch in the following functions:
> 
> Int4
> PGtype_precision(StatementClass *stmt, Int4 type, int col, int
>  handle_unknown_size_as)
> {
> 
>  switch (type)
>  {
> 
>   case PG_TYPE_CHAR:
>    return 1;
> ...
> 
> }
> 
> char *
> pgtype_create_params(StatementClass *stmt, Int4 type)
> {
>  switch (type)
>  {
>    case PG_TYPE_CHAR:
>    case PG_TYPE_VARCHAR:return "max. length";
>   default:
>    return NULL;
>  }
> }
> 
> "case PG_TYPE_CHAR" should be changed to "case PG_TYPE_BPCHAR", or
> there will be a error when use SQLGetTypeInfo. Because the precision
> of PG_TYPE_CHAR is 1, it should return NULL in function
> "pgtype_create_params" instead of "max. length"!!!
> 
> What do you think?

You seem to be right.
I would change PG_TYPE_CHAR to PG_TYPE_BPCHAR.

Thanks for your report. 

Hiroshi Inoue
	http://w2422.nsk.ne.jp/~inoue/



In response to

pgsql-odbc by date

Next:From: Markus WollnyDate: 2002-07-05 17:20:05
Subject: Performance of ODBC-Driver /w IIS5.0/ColdFusion
Previous:From: Zhou HanDate: 2002-07-04 14:20:01
Subject: Problem with SQLGetTypeInfo

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