Subject: [pgjdbc/pgjdbc] PR #3386: Fix getSchemas()

From: "SophiahHo (@SophiahHo)" <[email-masked]>
Date: Fri, 20 Sep 2024 17:49:13 +0000

Fixes https://github.com/pgjdbc/pgjdbc/issues/3385 "Column alias names for metadata returned by getSchemas() violate JDBC spec"

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document?
* [x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### Changes to Existing Features:

* [ ] Does this break existing behaviour? If so please explain.
* [x] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] Have you written new tests for your core changes, as applicable?
* [ ] Have you successfully run tests with your changes locally?

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Fri, 20 Sep 2024 19:13:09 +0000

@SophiahHo 
Thanks for the PR. I think there are a few other places that need to have the same applied.

Also wouldn't https://github.com/pgjdbc/pgjdbc/blob/0f6bf16878de50d82c8c59a7d1da1b5641c084be/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L1612 need to be fixed ?

---

From: "SophiahHo (@SophiahHo)" <[email-masked]>
Date: Fri, 20 Sep 2024 19:49:34 +0000

@davecramer Fixed the ORDER BY clause. Do I need to fix all the other places before this PR is approved?

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Fri, 20 Sep 2024 20:57:22 +0000

> @davecramer Fixed the ORDER BY clause. Do I need to fix all the other places before this PR is approved?

I would certainly appreciate it if you did.

---

From: "jorsol (@jorsol)" <[email-masked]>
Date: Sat, 21 Sep 2024 09:34:27 +0000

Also some tests would be nice.

---

From: "SophiahHo (@SophiahHo)" <[email-masked]>
Date: Wed, 25 Sep 2024 15:38:35 +0000

@davecramer I fixed it in the other places. Please approve.

---

From: "lukaseder (@lukaseder)" <[email-masked]>
Date: Wed, 15 Jan 2025 09:11:59 +0000

While I agree with the fix per se, I find the change to be quite significant in a patch release. It will break all sorts of client code, e.g.:

- https://github.com/jOOQ/jOOQ/issues/17873

In particular, it absolutely does break existing behaviour!

> * Does this break existing behaviour? If so please explain.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 16 Jan 2025 13:58:32 +0000

Ya, sorry about that. In general we consider fixing things to meet the JDBC spec to be a bug rather than a feature. Agreed it's on the edge.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Mon, 10 Feb 2025 19:54:24 +0000

@SophiahHo I don't think the fix for getCatalogs() is correct. There is only one catalog in the connection.

---

From: "SophiahHo (@SophiahHo)" <[email-masked]>
Date: Mon, 10 Feb 2025 22:19:40 +0000

@davecramer The [getCatalogs() change to return all catalogs](https://github.com/pgjdbc/pgjdbc/commit/9ea59bd87f7920f1c2aba20ffef15acef85def60) was committed by someone else (not me) in 2023, and it relates to https://github.com/pgjdbc/pgjdbc/pull/3390 instead of this PR. https://github.com/pgjdbc/pgjdbc/issues/3389#issuecomment-2414487622 explains the interaction.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Mon, 10 Feb 2025 23:48:49 +0000

@SophiahHo you are correct, sorry for calling you out there.