Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Wed, 09 Apr 2025 18:39:13 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 2790617413 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3528 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3528#issuecomment-2790617413 Content-Type: text/plain; charset=utf-8 I think it should be uncommon for the client code to ask for a list of "procedures in a foreign catalog", so it should be fine to go with `and false` trick. At the same time, certain cases make it easy to return empty resultset without making a database roundtrip. @SophiahHo , in some of the cases, we use `org.postgresql.core.BaseStatement#createDriverResultSet(Field[] fields, List tuples)` can create resultset. For instance, `getProcedureColumns` prepares `Field[]` declaration, and then it executes a query. In that case we could use something like ```java if (catalog != null && !catalog.equals(...)) { // Returns empty resultset ((BaseStatement) createMetaDataStatement()).createDriverResultSet(f, v) } ``` I guess Dave meant something like that. WDYT?