pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan-Peter Seifert <Jan-Peter.Seifert@gmx.de>
To: pgsql-odbc@postgresql.org
Subject: SQLDescribeCol – schema cache not being updated completely?
Date: Thu, 05 May 2011 16:38:06 +0200
Message-ID: <20110505143806.24920@gmx.net> (raw)

Hello,

we looked into a problem caused by some changes to a db’s schema via psqlODBC - e.g.:

Creating table:
SQLExecDirect(stmt, ‘CREATE TABLE tab1 (sp1 character varying(10));’, SQL_NTS)

Selecting from column:
SQLExecDirect(stmt, ‘SELECT sp1 from tab1’, SQL_NTS)

Getting column description:
SQLDescribeCol(stmt, 1, …) => 
ColumnName = "sp1", DataType = SQL_VARCHAR=12, ColumnSize = 10, DecimalDigits = 0, Nullable = SQL_NULLABLE=1

SQLCloseCursor(stmt);

Altering the column:
SQLExecDirect(stmt, ‘ALTER TABLE tab1 ALTER COLUMN sp1 TYPE char(25);’, SQL_NTS)
SQLExecDirect(stmt, ‘ALTER TABLE tab1 ALTER COLUMN sp1 SET NOT NULL;’, SQL_NTS)

Selecting from column again:
SQLExecDirect(stmt, ‘SELECT sp1 from tab1’, SQL_NTS)

Getting new column description:
SQLDescribeCol(stmt, 1, …)=>
ColumnName = "sp1", DataType = SQL_CHAR=1, ColumnSize = 10, DecimalDigits = 0, Nullable = SQL_NULLABLE=1

Obviously the Datatype information has been updated but ColumnSize und SQL_NULLABLE have been not.

It’s the same for  DecimalDigits/SQL_NUMERIC

This has been tested with version 8.04.02.00 and 9.00.02.00 of psqlODBC.

Could you check into this, please?

Thank you very much,

Peter

P.S. Is there a way to flush/refresh this ‘schema’ cache completely or for a single table 'manually' during runtime?

-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone



view thread (3+ messages)  latest in thread

Message-ID: <20110505143806.24920@gmx.net>
Permalink:  ../20110505143806.24920@gmx.net/
Also on:    postgresql.org/message-id/20110505143806.24920@gmx.net

 · 

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: Jan-Peter.Seifert@gmx.de
  Subject: Re: SQLDescribeCol – schema cache not being updated completely?
  In-Reply-To: <20110505143806.24920@gmx.net>
  References: <20110505143806.24920@gmx.net>

* 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