Thread: Metadata/ODBC query

Metadata/ODBC query

From
"jerry.evans@chordia"
Date:
Hi
 
I'm experimenting with PostgreSQL 8.3.0 on Windows connecting via ODBC. One curiosity so far is this:
 
If I use pgAdmin and run "SELECT catalog_name FROM Information_Schema.Schemata" I get data back as expected.
 
If I connect via ODBC and issue the same query I don't see any data. SQLFetch() simply returns SQL_NO_DATA_FOUND. Both ODBC test apps work fine when accessing the same server/database running queries such as "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type = 'BASE TABLE'"
 
I'm using the latest psqlODBC Windows installer from the web site. The driver is set to show system tables ...
 
Any clues?
 
Thanks.
 
Jerry.

Re: Metadata/ODBC query

From
Tom Lane
Date:
"jerry.evans@chordia" <jerry.evans@chordia.co.uk> writes:
> If I use pgAdmin and run "SELECT catalog_name FROM Information_Schema.Schemata" I get data back as expected.

> If I connect via ODBC and issue the same query I don't see any data.

What userid are you connecting as under ODBC?  Has it got privileges to
any of the schemas?  The information_schema views generally hide objects
that you have no privileges for ...

            regards, tom lane

Re: Metadata/ODBC query

From
Tom Lane
Date:
I wrote:
> What userid are you connecting as under ODBC?  Has it got privileges to
> any of the schemas?  The information_schema views generally hide objects
> that you have no privileges for ...

In fact, looking closer, it looks like the schemata view only shows you
schemas that you are the *owner* of (as is required by spec).  So a
superuser would see everything but ordinary users might well not see
anything.

            regards, tom lane