pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3504: Wrong schemas fetched for a given catalog as input
Date: Tue, 04 Feb 2025 15:58:49 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
I just tried this with the latest 42.7.5 and was unable to replicate these results:
```
public static void getSchemas(String catalog) throws SQLException
{
try (Connection conn = DriverManager.getConnection(DB_URL, USER,PASS))
{
ResultSet rs = null;
if (catalog != null && catalog.length() > 0){
System.out.println(String.format("Connected to %s, setting catalog: %s",DB_URL, catalog));
conn.setCatalog(catalog);
}
rs = conn.getMetaData().getSchemas();
while (rs.next())
{
String schema = rs.getString("TABLE_SCHEM");
System.out.println("schema:"+schema);
}
}
catch (SQLException e)
{
e.printStackTrace();
}
}
```
Produces when connected to database `foo`
```
Connected to jdbc:postgresql://localhost:5432/foo, setting catalog: foo
schema:blah
schema:information_schema
schema:pg_catalog
schema:public
```
and when connected to database `test`
```
Connected to jdbc:postgresql://localhost:5432/test, setting catalog: foo
schema:information_schema
schema:pg_catalog
schema:public
```
view thread (25+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #3504: Wrong schemas fetched for a given catalog as input
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox