Message-ID: From: "kneth (@kneth)" To: "pgjdbc/pgjdbc" Date: Thu, 24 Apr 2025 10:58:25 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3526: Set column name explicitely when using `current_database()` in queries In-Reply-To: References: List-Id: X-GitHub-Author-Login: kneth X-GitHub-Comment-Id: 2058115004 X-GitHub-Comment-Type: review_comment X-GitHub-Commit: 532c217a5c7d5ee4b136873a9ad822330a761091 X-GitHub-Issue: 3526 X-GitHub-Path: pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: review_comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3526#discussion_r2058115004 Content-Type: text/plain; charset=utf-8 (on pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java) There are many checks like the following in the code: ```java if (catalog != null) { sql += " AND current_database() = " + escapeQuotes(catalog); } ``` They will not exclude `null`. Likewise, the additional checks in #3588 don't exclude `catalog` to be `null` afaik. Removing the `try`/`catch` makes sense as errors can bubble up to the application.