Skip to content

build-pg-focal: take the patch series from PGDG's packaging of the same minor - #1244

Open
Kemal Büyükkaya (kemalbuyukkaya) wants to merge 1 commit into
developfrom
users/kbuyukkaya/align-pg-focal-patches-with-pgdg
Open

Kemal Büyükkaya (kemalbuyukkaya) wants to merge 1 commit into
developfrom
users/kbuyukkaya/align-pg-focal-patches-with-pgdg

Conversation

@kemalbuyukkaya

Copy link
Copy Markdown
Contributor

Problem

The focal build combines a new upstream minor with PGDG's frozen focal debian/ packaging, including its patch series. That series stops at the last focal minor (13.21 / 14.18 / 15.13 / 16.9 / 17.5), but PGDG kept changing patches for later minors. Compared with what PGDG ships today for the same minors:

Major Missing (PGDG ships it) Still applied (PGDG dropped it)
14, 15, 16 v2-0001-psql-count-every-COPY-FROM-STDIN…: fixes a psql regression in 14.24/15.19/16.15 where psql -c "SELECT 1; COPY t FROM STDIN" aborts with unexpected COPY_IN result, aborting connection –
16 – v8-0001-Fix-recovery-conflict-SIGUSR1-handling (an unmerged rewrite of core server code) and pgstat-report-conflicts-immediately. PGDG dropped both in 16.10 as s390x workarounds.
all – jit-s390x, focal-arm64-outline-atomics (both do nothing on amd64)

Everything else matches PGDG. A rebuild of 16.9 compared against PGDG's own 16.9 focal debs showed identical configure/compiler flags, gcc 9.4, LLVM 10, dependencies, file lists and hardening.

Fix

In step [3/6] of scripts/build_pg_focal, replace debian/patches with the series from PGDG's jammy packaging of the minor being built (live pool). The tarball's sha256 is checked against its .dsc. PGDG's series is byte-identical across all its distros for a given minor, so jammy works as the source. The rest of the frozen focal debian/ stays, so the LLVM 10 strategy is unchanged.

  • No manual work each quarter: when a fix lands upstream, PGDG drops the patch and we follow automatically.
  • PG_DROP_PATCHES stays as an override, but no longer needs a default (hurd-iovec isn't in the current series).
  • The changelog entry records which packaging the patch series came from.

Validation

Ran locally with podman, using the image built from dockerfiles/focal-pg-builder:

  • PG13–16 build. Each uses PGDG's series for the same minor, and all patches apply with zero fuzz. Changes from the frozen series:
    • PG13: -focal-arm64-outline-atomics -jit-s390x
    • PG14/15: those two, plus +v2-0001-psql-…
    • PG16: also -hurd-iovec -v8-0001-… -pgstat-report-conflicts-immediately
  • psql regression: psql -c 'SELECT 1; COPY t FROM STDIN' loads its rows on 13.23/14.24/15.19/16.15. The currently shipped 16.15 build (run 37928058376) fails with unexpected COPY_IN result.
  • PG16 server: no longer contains the v8 patch's symbols.
  • scripts/smoke_test_focal_debs passes on the combined 13–16 set (59 packages, 4 clusters, JIT available on all).
  • PG16 with RUN_TESTS=1 (combined with build-pg-focal: build unprivileged so RUN_TESTS=1 can run initdb #1243): the full upstream test suite passes, including the 9 new psql COPY TAP checks from PGDG's patch.

Independent of #1243; they touch different parts of the script.

…me minor

The build reused the frozen focal debian/ packaging wholesale, including its
patch series, which stops at the last focal minor (13.21/14.18/15.13/16.9).
So our newer minors drifted from what PGDG ships for them:

  * 14.24/15.19/16.15 lacked PGDG's psql fix for the COPY FROM STDIN
    regression in those minors: psql -c "SELECT 1; COPY t FROM STDIN"
    aborted with "unexpected COPY_IN result, aborting connection".
  * 16.x still carried v8-0001-Fix-recovery-conflict-SIGUSR1-handling
    (an unmerged core-server rework) and pgstat-report-conflicts-
    immediately, which PGDG dropped in 16.10 as s390x workarounds.

PGDG's patch series is identical across distros for a given minor, so take
debian/patches from their jammy packaging of the minor we build, verified
against its .dsc. The rest of the frozen focal debian/ stays, keeping
LLVM 10. PG_DROP_PATCHES no longer needs a default (hurd-iovec is not in
the current series).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The patch selection, checksum verification, extraction, and existing build flow are consistent and complete.

0 open findings

What changed in this PR

Updates focal PostgreSQL builds to use PGDG’s patch series for the matching minor release.

Changes:

  • Downloads and verifies Jammy patch packaging.
  • Preserves optional patch exclusions and records the source in the changelog.
  • Documents the revised packaging strategy.
File Description
scripts/​build_pg_focal Replaces frozen patches with the verified matching PGDG series.
dockerfiles/​focal-pg-builder/​Dockerfile Documents the patch source.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants