pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin J. Evans <bohica@ntlworld.com>
To: pgsql-odbc@postgresql.org
Subject: SQLGetTypeInfo does not return COLUMN_SIZE
Date: Fri, 04 Oct 2013 18:01:09 +0100
Message-ID: <524EF455.6050409@ntlworld.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (3+ messages)  latest in thread

Message-ID: <524EF455.6050409@ntlworld.com>
Permalink:  ../524EF455.6050409@ntlworld.com/
Also on:    postgresql.org/message-id/524EF455.6050409@ntlworld.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: bohica@ntlworld.com
  Subject: Re: SQLGetTypeInfo does not return COLUMN_SIZE
  In-Reply-To: <524EF455.6050409@ntlworld.com>
  References: <524EF455.6050409@ntlworld.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox