I'm submitting a ...
Describe the issue
I'd be willing to work on this and submit a PR (along with fixing a few other catalog-specific oddities in the implementation of DatabaseMetaData), but I thought I'd test the waters first. :)
PostgreSQL does not support multiple catalogs per connection, which is why it makes sense that methods such as setCatalog on Connection are no-op. However, PostgreSQL does in fact share the "system table" pg_database across all catalogs, making it possible to see what other catalogs exist and potentially open connections to them.
Right now, the driver only returns the current catalog for the getCatalogs implementation of DatabaseMetaData which unfortunately makes it impossible to check what other databases exist without resorting to DB-specific queries. I'd like to modify this implementation so that it returns the names in pg_database. Results of other metadata methods involving catalog names would not be affected (though I would suggest adding validations to them for catalog values that the current connection simply cannot support).
Driver Version?
v42.6.0
I'm submitting a ...
Describe the issue
I'd be willing to work on this and submit a PR (along with fixing a few other catalog-specific oddities in the implementation of
DatabaseMetaData), but I thought I'd test the waters first. :)PostgreSQL does not support multiple catalogs per connection, which is why it makes sense that methods such as
setCatalogonConnectionare no-op. However, PostgreSQL does in fact share the "system table"pg_databaseacross all catalogs, making it possible to see what other catalogs exist and potentially open connections to them.Right now, the driver only returns the current catalog for the
getCatalogsimplementation ofDatabaseMetaDatawhich unfortunately makes it impossible to check what other databases exist without resorting to DB-specific queries. I'd like to modify this implementation so that it returns the names inpg_database. Results of other metadata methods involving catalog names would not be affected (though I would suggest adding validations to them for catalog values that the current connection simply cannot support).Driver Version?
v42.6.0