Sort DO_SUBSCRIPTION_REL dump objects independent of OIDs. REL_18_STABLE github/REL_18_STABLE
authorNoah Misch <[email protected]>
Thu, 18 Dec 2025 18:23:47 +0000 (10:23 -0800)
committerNoah Misch <[email protected]>
Thu, 18 Dec 2025 18:23:51 +0000 (10:23 -0800)
commit573e679a26649e14742b4a7d19331bf8ced908ae
tree8f0dd0aa9be75e0907e941f6b828ec9de8d8543b
parentd77a5f98176ffaf3a537f4683ec87044c21bb98c
Sort DO_SUBSCRIPTION_REL dump objects independent of OIDs.

Commit 0decd5e89db9f5edb9b27351082f0d74aae7a9b6 missed
DO_SUBSCRIPTION_REL, leading to assertion failures.  In the unlikely use
case of diffing "pg_dump --binary-upgrade" output, spurious diffs were
possible.  As part of fixing that, align the DumpableObject naming and
sort order with DO_PUBLICATION_REL.  The overall effect of this commit
is to change sort order from (subname, srsubid) to (rel, subname).
Since DO_SUBSCRIPTION_REL is only for --binary-upgrade, accept that
larger-than-usual dump order change.  Back-patch to v17, where commit
9a17be1e244a45a77de25ed2ada246fd34e4557d introduced DO_SUBSCRIPTION_REL.

Reported-by: vignesh C <[email protected]>
Author: vignesh C <[email protected]>
Discussion: https://postgr.es/m/CALDaNm2x3rd7C0_HjUpJFbxpAqXgm=QtoKfkEWDVA8h+JFpa_w@mail.gmail.com
Backpatch-through: 17
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump_sort.c
src/bin/pg_upgrade/t/004_subscription.pl