Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 96024633235 for ; Fri, 25 Sep 2009 09:08:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60708-03 for ; Fri, 25 Sep 2009 12:08:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 1AD6C63234E for ; Fri, 25 Sep 2009 09:08:28 -0300 (ADT) Received: (qmail 31646 invoked by uid 512); 25 Sep 2009 12:08:08 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 25 Sep 2009 12:08:08 -0000 Received: from unknown (HELO ?192.168.24.54?) (219.111.80.78) by sd.tpf.co.jp with SMTP; 25 Sep 2009 12:08:08 -0000 Message-ID: <4ABCB2A7.5080000@tpf.co.jp> Date: Fri, 25 Sep 2009 21:08:07 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: stephen.hindmarch@bt.com CC: pgsql-odbc@postgresql.org Subject: Re: SQLColumns does not allow schema name References: <6218342DD4A57C41A67FC276D91E625C09CB7E1E@E03MVY2-UKDY.domain1.systemhost.net> In-Reply-To: <6218342DD4A57C41A67FC276D91E625C09CB7E1E@E03MVY2-UKDY.domain1.systemhost.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.117 tagged_above=-10 required=5 tests=BAYES_00=-2.599, DNS_FROM_RFC_BOGUSMX=1.482 X-Spam-Level: X-Archive-Number: 200909/25 X-Sequence-Number: 10011 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 > >