From: | "Martin J(dot) Evans" <bohica(at)ntlworld(dot)com> |
---|---|
To: | pgsql-odbc(at)postgresql(dot)org |
Subject: | SQLGetTypeInfo does not return COLUMN_SIZE |
Date: | 2013-10-04 17:01:09 |
Message-ID: | 524EF455.6050409@ntlworld.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
I may have discovered an issue with the postgres ODBC Driver.
Postgres ODBC Driver version:
perl -MDBI -le 'my $h = DBI->connect; print $h->get_info(7);'
09.00.0310
Platform: Linux, Ubuntu
I maintain Perl DBD::ODBC and the test suite shows a problem because when calling SQLGetTypeInfo some types return
'CREATE_PARAMS' => 'max. length'
but then the COLUMN_SIZE is missing. e.g.:
$VAR1 = {
'UNSIGNED_ATTRIBUTE' => undef,
'MAXIMUM_SCALE' => undef,
'INTERVAL_PRECISION' => '0',
'CREATE_PARAMS' => 'max. length',
'NUM_PREC_RADIX' => undef,
'PRECISION' => 255,
'SEARCHABLE' => '3',
'MONEY' => '0',
'AUTO_INCREMENT' => undef,
'LOCAL_TYPE_NAME' => undef,
'LITERAL_PREFIX' => '\'',
'MINIMUM_SCALE' => undef,
'TYPE_NAME' => 'varchar',
'NULLABLE' => '1',
'DATA_TYPE' => 12,
'SQL_DATA_TYPE' => '12',
'LITERAL_SUFFIX' => '\'',
'CASE_SENSITIVE' => '1',
'SQL_DATETIME_SUB' => undef
};
See http://msdn.microsoft.com/en-us/library/ms714632%28v=vs.85%29.aspx where COLUMN_SIZE was introduced in ODBC 2 (decades ago) and should exist in the columns returned. Without it, the application cannot know what to put in varchar (size_here) after a column in a create table.
I've put in a special case for now to work around this problem but it issues a warning too. If you need anything further from me please let me know.
Martin
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2013-10-28 08:10:46 | Code not compiling since 19d5486 due to concatenate operators in macros |
Previous Message | Heikki Linnakangas | 2013-10-03 07:13:12 | Re: Fwd: pgsql - ODBC Config.html document |