Message-ID: From: "hlcianfagna (@hlcianfagna)" To: "pgjdbc/pgjdbc" Date: Thu, 20 Feb 2025 11:45:16 +0000 Subject: [pgjdbc/pgjdbc] PR #3533: refactor: Use key_column_usage instead of indnkeyatts in PgDatabaseMetaData for faster speed and improved compatibility List-Id: X-GitHub-Author-Id: 110453267 X-GitHub-Author-Login: hlcianfagna X-GitHub-Issue: 3533 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3533 Content-Type: text/plain; charset=utf-8 https://github.com/pgjdbc/pgjdbc/pull/3434 introduced a change to avoid mistakenly treating included columns as part of the PK, however the way this is done relies on a particular metadata field which some "PostgreSQL-compatible" database systems (e.g. CrateDB) do not populate in the same way as PostgreSQL does, this refactor addresses this by getting the same information via the standard `information_schema.key_column_usage` view, this has the added benefit of shaving a few milliseconds on the `getPrimaryKeys` call. ### All Submissions: * [YES] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document? * [YES] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change? ### Changes to Existing Features: * [NO] Does this break existing behaviour? If so please explain. * [YES] Have you added an explanation of what your changes do and why you'd like us to include them? * [NA] Have you written new tests for your core changes, as applicable? * [YES] Have you successfully run tests with your changes locally?