Re: getTables() not working for information_schema or pg_catalog

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getTables() not working for information_schema or pg_catalog
Date: 2005-11-25 23:49:16
Message-ID: dm87tt$vp$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote on 25.11.2005 23:42:
>> con.getMetaData().getTables(null, "information_schema", "%", null);
>>
>> (where con is a java.sql.Connection), I would assume to get all tables
>> that are stored in the information_schema, but the returned ResultSet
>> is empty (next() immediately returns false).
>>
>> The same is true when I call it with "pg_catalog"
>> Passing null for the table name does not make a difference.
>>
>
> The usage of null as the last parameter for table types makes the driver
> return only the default table types, not all of getTableTypes(). Things
> like "SYSTEM TABLE" are not included in the default list so this is why
> you get nothing from information_schema and pg_catalog. Re-reading the
> javadoc, it says "types - a list of table types to include; null returns
> all types". So clearly we're in violation of that. Will look at a fix.
>

You are right, when I pass all the types from getTableTypes() then I'll
get everything. I can live with that for now, but according to the docs
this indeed should work differently.

Thanks for your help
Thomas

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jaime Casanova 2005-11-26 05:52:22 Re: SQLJ, any plans?
Previous Message Oliver Jowett 2005-11-25 23:40:54 Re: SQLJ, any plans?