| From: | vignesh C <vignesh21(at)gmail(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Preserve conflict log table during upgrade |
| Date: | 2026-11-27 04:17:44 |
| Message-ID: | CALDaNm3e8xL9biWPRb7rVGW8m9pnQofjGXx6WV1CKS934VwFqw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
During the review of the conflict log table patch, it was suggested
that subscription OID preservation be split into a separate patch at
[1], as it is also needed for the commit timestamp upgrade work.
Accordingly, the first patch handles subscription OID preservation,
while the second patch handles preserving conflict log tables and
conflict_log_destination across upgrades.
0001: Preserve subscription OIDs across pg_upgrade
In binary-upgrade mode, pg_dump emits
binary_upgrade_set_next_pg_subscription_oid() before each CREATE
SUBSCRIPTION, and CreateSubscription() uses this OID instead of
assigning a new one. This requires adding a new pg_upgrade_support
function and therefore a catversion bump. The change is independent of
conflict log tables and is also needed for the upcoming commit
timestamp upgrade at [2].
0002: Preserve conflict log tables and conflict_log_destination during upgrade
The name of a conflict log table is derived from the subscription OID,
and the table is referenced through
pg_subscription.subconflictlogrelid. In binary-upgrade mode, pg_dump
now dumps conflict log tables with their original OIDs, along with
their privileges, comments, and security labels. CreateSubscription()
links the subscription to the already restored conflict log table and
reports an error if the table is missing. A conflict log table is
dumped only when its subscription is also selected for dumping. In
normal mode, conflict log tables and their associated metadata are not
dumped, since the tables are created again when the subscription is
restored. The ACLs of the pg_conflict schema are dumped in the same
way as those of pg_catalog.
This version only splits the v98 patch posted at [3] into two patches;
there are no other changes.
[1] - https://www.postgresql.org/message-id/CAA4eK1%2Bz29LbhwRqJy9KXV%2B1s2a7hkqq5MGX1WYvcQ%3DwkkpK%3DQ%40mail.gmail.com
[2] - https://www.postgresql.org/message-id/CAFPTHDa5aP8ixTZBygGAe48E1N=DvuPzcXikw7bNKixLMN3pVg@mail.gmail.com
[3] - https://www.postgresql.org/message-id/CALDaNm08sHU%3DBowHwEdurWt0-XwsAYB0drL_1%3DS-_XJC4atnqQ%40mail.gmail.com
Regards,
Vignesh
| Attachment | Content-Type | Size |
|---|---|---|
| 0001-Preserve-subscription-OIDs-across-pg_upgrade.patch | application/octet-stream | 10.4 KB |
| 0002-Preserve-conflict-log-tables-and-conflict_log_destin.patch | application/octet-stream | 24.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ayush Tiwari | 2026-11-27 04:26:18 | postgres_fdw can crash on malformed remote results |
| Previous Message | 胡常齐 | 2026-11-27 03:59:12 | Subject: [PATCH] Define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY on LoongArch64 |