Subject: [pgjdbc/pgjdbc] PR #3588: refactor empty resultset to use empty result set if the catalog is not correct

From: "davecramer (@davecramer)" <[email-masked]>
Date: Fri, 04 Apr 2025 20:14:42 +0000

Alternative to https://github.com/pgjdbc/pgjdbc/pull/3528

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Tue, 08 Apr 2025 09:40:58 +0000

I did put in a check for isvalid() but looking at the rest of the code we return many functions without verifying the connection is valid.

Thoughts @vlsi @sehrope ?

---

From: "sehrope (@sehrope)" <[email-masked]>
Date: Tue, 08 Apr 2025 16:06:38 +0000

If we're not doing it other places and have no intention of adding this check everywhere, we should not be including it here either.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Tue, 08 Apr 2025 17:02:01 +0000

works for me. I'll remove the checks

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Sun, 13 Apr 2025 08:49:20 +0000

(on pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java:1270)

`"" retrieves those without a catalog`
I assume PostgreSQL does not have "procedures without a catalog", so `catalog.isEmpty()` check looks redundant here. WDYT of replacing this with `catalog != null && (catalog.isEmpty() || !catalog.equals(connection.getCatalog()))`

`!Objects.equals(catalog, connection.getCatalog())` could do as well (at a cost of one-time SQL in `getCatalog()`)