pg_dump crash due to incomplete ordering of DO_SUBSCRIPTION_REL objects

From: vignesh C <vignesh21(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Noah Misch <noah(at)leadboat(dot)com>
Subject: pg_dump crash due to incomplete ordering of DO_SUBSCRIPTION_REL objects
Date: 2025-12-15 18:05:35
Message-ID: CALDaNm2x3rd7C0_HjUpJFbxpAqXgm=QtoKfkEWDVA8h+JFpa_w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While verifying upgrade of subscriber instance, I noticed pg_dump
crash caused by incomplete sorting logic for DO_SUBSCRIPTION_REL
objects in DOTypeNameCompare(). When multiple subscription–relation
entries belong to the same subscription, the comparison does not
establish a complete ordering. In this case, the comparison falls
through to the generic assertion path. The attached patch fixes this
by extending the comparison for DO_SUBSCRIPTION_REL objects to include
deterministic ordering keys. After the subscription name comparison,
entries are ordered by the referenced table's schema name and then by
table name.

This issue has started failing after commit:
commit 0decd5e89db9f5edb9b27351082f0d74aae7a9b6
Sort dump objects independent of OIDs, for the 7 holdout object types.

This can be reproduced by having logical replication setup with
subscription subscribing to few tables.

Thanks,
Vignesh

Attachment Content-Type Size
0001-Fix-pg_dump-crash-for-DO_SUBSCRIPTION_REL-sorting.patch application/octet-stream 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2025-12-15 18:23:41 Re: [PATCH] Fix severe performance regression with gettext 0.20+ on Windows
Previous Message Euler Taveira 2025-12-15 17:51:49 Re: create table like including storage parameter