Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4C3181337BEF for ; Thu, 5 May 2011 11:38:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 59318-06 for ; Thu, 5 May 2011 14:38:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mail.postgresql.org (Postfix) with SMTP id 43E471337BF2 for ; Thu, 5 May 2011 11:38:10 -0300 (ADT) Received: (qmail 29794 invoked by uid 0); 5 May 2011 14:38:08 -0000 Received: from 94.100.136.25 by www115.gmx.net with HTTP; Thu, 05 May 2011 16:38:06 +0200 (CEST) Content-Type: text/plain; charset="utf-8" Date: Thu, 05 May 2011 16:38:06 +0200 From: "Jan-Peter Seifert" Message-ID: <20110505143806.24920@gmx.net> MIME-Version: 1.0 Subject: =?utf-8?Q?SQLDescribeCol_=E2=80=93_schema_cache_not_being_updated?= =?utf-8?Q?_completely=3F?= To: pgsql-odbc@postgresql.org X-Authenticated: #955937 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+m/35cBVWmo72SJJ0aFgaJLyMzO+QYV0rJWBbkTh TX2MfvGzcduVOE6bB72GPM+DTUNR2FJOI2kA== Content-Transfer-Encoding: 8bit X-GMX-UID: IcOrfvFHeWUkV1PwZ29nuNgjL0tsZk3E X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.889 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/4 X-Sequence-Number: 10651 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