RE: Connection.setCatalog()

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <jason(at)netspade(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: RE: Connection.setCatalog()
Date: 2001-07-16 20:17:18
Message-ID: Pine.LNX.4.30.0107162209540.680-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

jason(at)netspade(dot)com writes:

> What do they mean by database though? It is vague because the
> definitions are not clear, but I interpret it like this: A "catalog"
> equals "PostgreSQL database" which is a subset of the whole "database"
> assuming "database" in this context to mean the whole server. I
> realise that the "catalog" is fixed but this is also the case for
> MySQL. Note it doesn't say "in current connection" so no reason why
> you can't create a new one. The bottom line is that supporting them
> would make life easier for people like me writing a database admin
> tool.

This seems like a reasonable interpretation. Given that the alternative
would be to not implement it at all, I would agree if you'd implement it
as suggested.

> > > The DatabaseMetaData.supportsCatalogsInXXX() may need to be modified.
> >
> > These methods are all implemented correctly.
> >
> > > I'm not sure about the stuff in DatabaseMetaData.getTables() for
> > > example - at the moment specifying null gets all the tables in the
> > > database which the driver is currently connected to. I think this is
> > > fine - but different database name patterns might be specified and
> > > they may have to be implemented?
> >
> > Yup. We'll just throw an SQLException in that case.
>
> Yes, that isn't really a problem. But _if_ you want to support catalogs maybe you have to go the whole way?

Do you mean that DatabaseMetaData.getTables() in a catalog other than the
current one should reset the connection to the new catalog? That sounds a
bit too revolutionary to me, but then again, as above, the alternative is
to not allow it at all.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message jason 2001-07-16 22:28:46 RE: Connection.setCatalog()
Previous Message jason 2001-07-15 22:49:58 RE: Connection.setCatalog()