Metadata/ODBC query

Started by jerry.evans@chordiaabout 18 years ago3 messagesgeneral
Jump to latest
#1jerry.evans@chordia
jerry.evans@chordia.co.uk

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.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: jerry.evans@chordia (#1)
Re: Metadata/ODBC query

"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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: Metadata/ODBC query

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