[unixODBC-support] Different behavior of Linux and Windows PostgreSQL ODBC driver

Nick Gorham nick.gorham at easysoft.com
Fri Nov 24 11:47:04 GMT 2006

Luca Devoti wrote:

>Hi all,
>I'm testing the Linux ODBC driver for Postgres on Linux RH 7.1.
>I have a different behavior when calling SQLGetTypeInfo().
>In fact what I get from the Linux driver is that the Char type is a driver defined type while on Windows I get it as a base type.
Just had a look, if I understand the problem, edit 
Drivers/Postgre7.1/pgtypes.c and look for the function 
pgtype_create_params and change it to

char *pgtype_create_params(StatementClass *stmt, Int4 type)
    switch(type) {
    case PG_TYPE_BPCHAR:
    case PG_TYPE_CHAR:
    case PG_TYPE_VARCHAR:       return "max. length";
    case PG_TYPE_NUMERIC:       return "precision, scale";
    default:                    return NULL;

Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org

More information about the unixODBC-support mailing list