Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Tue, 02 Jun 2026 12:19:46 +0000 Subject: [pgjdbc/pgjdbc] PR #4134: ci: update GitHub Actions and fix PostgreSQL 18 metadata query on release/42.2.x List-Id: X-GitHub-Additions: 22 X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Base: release/42.2.x X-GitHub-Changed-Files: 2 X-GitHub-Commits: 3 X-GitHub-Deletions: 8 X-GitHub-Head-Branch: chore/update-actions-42.2 X-GitHub-Head-SHA: a1404da1f6bf62d985cede83a5586fe4c1812d2e X-GitHub-Issue: 4134 X-GitHub-Labels: chore X-GitHub-Merge-SHA: 9ac918636228a6c54eeac8785f6f44d5ce0f294c X-GitHub-Merged-By: vlsi X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4134 Content-Type: text/plain; charset=utf-8 ## What - Bump `actions/setup-java` from v1 to v3 across the CI workflow, requesting the `zulu` distribution explicitly. `buildcache.yml` stays on v1 by design. - Run `apt update` before installing the GSS test dependencies. - Request the `RULE` privilege in `getTables`/`has_table_privilege` only on servers older than PostgreSQL 18. ## Why - `actions/setup-java@v1` runs on a Node runtime that GitHub-hosted runners no longer provide, so those steps fail to start. - `apt install` can fail when the runner's package index references versions the mirror has already dropped; `apt update` makes the GSS job resolve its dependencies reliably. - PostgreSQL 18 removed the long-deprecated `RULE` privilege. CI runs against `postgres:latest`, which is now 18, so `getTables` with `hideUnprivilegedObjects` failed there with `unrecognized privilege type: RULE`. `RULE` has been a no-op since 8.2, so dropping it on 18+ changes nothing. This mirrors the GitHub Actions and PostgreSQL 18 fixes already applied to release/42.3.x and master, adapted to the 42.2.x workflow layout. Several related items (`actions/checkout@v4`, `docker compose`, `postgresql-16` for GSS, the `Files.createTempFile` stub, the Gradle 7.6.6 / vlsi-release-plugins 1.90 bumps) are already on release/42.2.x and are not repeated here. ## How to verify - The `RULE` premise, on PostgreSQL 18.4: - `SELECT has_table_privilege('pg_class'::regclass, 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')` → `ERROR: unrecognized privilege type: "RULE"` - the same call without `RULE` succeeds. - CI: the `Code style`, `Ubuntu, PG latest`, `CheckerFramework`, `Source distribution`, and `gss encryption` jobs should start (no deprecated-runtime failure) and the metadata tests should pass against `postgres:latest`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f0e930adf..8864070e0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,8 +20,9 @@ jobs: with: fetch-depth: 50 - name: 'Set up JDK 8' - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: 8 - uses: burrunan/gradle-cache-action@v3 name: Verify code style @@ -68,8 +69,9 @@ jobs: working-directory: docker run: docker compose up -d && docker compose logs - name: 'Set up JDK ${{ matrix.jdk }}' - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: ${{ matrix.jdk }} - name: Prepare ssltest.local.properties run: echo enable_ssl_tests=true > ssltest.local.properties @@ -96,8 +98,9 @@ jobs: with: fetch-depth: 50 - name: 'Set up JDK 11' - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: 11 - uses: burrunan/gradle-cache-action@v3 name: Run CheckerFramework @@ -119,8 +122,9 @@ jobs: working-directory: docker run: docker compose up -d && docker compose logs - name: 'Set up JDK 11' - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: 11 - uses: burrunan/gradle-cache-action@v3 name: Prepare source distribution @@ -144,11 +148,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: 'Set up JDK 8' - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: 8 - name: 'Install software' - run: sudo apt -y install krb5-kdc krb5-admin-server libkrb5-dev postgresql-16 + run: | + sudo apt -y update + sudo apt -y install krb5-kdc krb5-admin-server libkrb5-dev postgresql-16 - name: 'Update hosts' run: | sudo -- sh -c "echo 127.0.0.1 localhost auth-test-localhost.postgresql.example.com > /etc/hosts" diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java index 42a54c49a1..db7f7bd298 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java @@ -1318,8 +1318,15 @@ public ResultSet getTables(@Nullable String catalog, @Nullable String schemaPatt select += " AND n.nspname LIKE " + escapeQuotes(schemaPattern); } if (connection.getHideUnprivilegedObjects()) { - select += " AND has_table_privilege(c.oid, " - + " 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')"; + // The RULE privilege was removed from has_table_privilege() in PostgreSQL 18: + // https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fefa76f70fdc75c91f80bddce2df7a8825205962 + if (connection.getServerMajorVersion() < 18) { + select += " AND has_table_privilege(c.oid, " + + " 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')"; + } else { + select += " AND has_table_privilege(c.oid, " + + " 'SELECT, INSERT, UPDATE, DELETE, REFERENCES, TRIGGER')"; + } } orderby = " ORDER BY TABLE_TYPE,TABLE_SCHEM,TABLE_NAME ";