pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: MaxMello (@MaxMello) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3543: Table meta data is broken if catalog name not equal database name
Date: Mon, 03 Mar 2025 13:43:35 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

One additonal info, calling `connection.getCatalog()` will return "read" or "write", but `metaData.getCatalogs()` will not return those values, instead only the proper dbname ("postgres"). 

I traced back how `getCatalog()` is implemented and if I understand the code correctly, it will at one point call `PGProperty.PG_DBNAME.getOrDefault(info);` which is "just" the path part of the connection url? 

Compared to that, `getCatalogs()` "properly" queries the database. Is it maybe requried to use something like `SELECT current_database();` to get the database / catalog name, instead of relying on the connection properties? At least in this use case with pgbouncer?

view thread (6+ 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 #3543: Table meta data is broken if catalog name not equal database name
  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