Skip site navigation (1) Skip section navigation (2)

Re: SQLColumns does not allow schema name

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: stephen(dot)hindmarch(at)bt(dot)com
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: SQLColumns does not allow schema name
Date: 2009-09-25 12:08:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
stephen(dot)hindmarch(at)bt(dot)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.

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

In response to


pgsql-odbc by date

Next:From: stephen.hindmarchDate: 2009-09-25 13:08:37
Subject: Re: SQLColumns does not allow schema name
Previous:From: AndrusDate: 2009-09-25 08:49:43
Subject: Re: 08.04.0100: Couldn't load libpq library

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group