From: Hiroshi Inoue <inoue@tpf.co.jp>
To: stephen.hindmarch@bt.com
Cc: pgsql-odbc@postgresql.org
Subject: Re: SQLColumns does not allow schema name
Date: Fri, 25 Sep 2009 21:08:07 +0900
Message-ID: <4ABCB2A7.5080000@tpf.co.jp> (raw)
In-Reply-To: <6218342DD4A57C41A67FC276D91E625C09CB7E1E@E03MVY2-UKDY.domain1.systemhost.net>
References: <6218342DD4A57C41A67FC276D91E625C09CB7E1E@E03MVY2-UKDY.domain1.systemhost.net>
stephen.hindmarch@bt.com wrote:
> I came across this problem while trying to debug another application
> that uses unix ODBC to access a Postgresql database. The application
> uses the SQLColumns function to describe tables. When the table is in
> the public schema and the table name is given just as "tname" then the
> columns are returned. When the table is given as "public.tname" then the
> request returns empty.
The declaration of SQLColumns() is the following.
SQLRETURN SQL_API
SQLColumns(HSTMT StatementHandle,
SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName,
SQLCHAR *szTableName, SQLSMALLINT cbTableName,
SQLCHAR *szColumnName, SQLSMALLINT cbColumnName);
We specify the schema name as the 4th parameter together with
the 5th length parameter.
> You can reproduce this in isql. If you connect to the database and do
> "help tname" you get the columns listed. If you try "help public.tname"
> no rows are returned. Selects return the same results either way, so it
> is just the description functions that appears broken.
>
> I am using unixODBC-2.2.12-9, Postgresql-odbc-08.03.0200-1 and
> Postgresql-server-8.3.8-1.
>
> Steve Hindmarch
> BT Design
>
>
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: inoue@tpf.co.jp, stephen.hindmarch@bt.com
Subject: Re: SQLColumns does not allow schema name
In-Reply-To: <4ABCB2A7.5080000@tpf.co.jp>
References: <6218342DD4A57C41A67FC276D91E625C09CB7E1E@E03MVY2-UKDY.domain1.systemhost.net> <4ABCB2A7.5080000@tpf.co.jp>
* 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