Message-ID: From: "MaxMello (@MaxMello)" To: "pgjdbc/pgjdbc" Date: Mon, 03 Mar 2025 13:43:35 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3543: Table meta data is broken if catalog name not equal database name In-Reply-To: References: List-Id: X-GitHub-Author-Login: MaxMello X-GitHub-Comment-Id: 2694444364 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2025-03-03T13:48:59Z X-GitHub-Issue: 3543 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3543#issuecomment-2694444364 Content-Type: text/plain; charset=utf-8 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?