Re: pg_dump crash due to incomplete ordering of DO_SUBSCRIPTION_REL objects

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump crash due to incomplete ordering of DO_SUBSCRIPTION_REL objects
Date: 2025-12-18 12:05:45
Message-ID: CALDaNm2eHvEu5q9grvJKdiaf0dWtbPZhz3BP3BNV=ADN6Moh6w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 18 Dec 2025 at 14:05, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>
>
> > On Dec 18, 2025, at 03:51, Noah Misch <noah(at)leadboat(dot)com> wrote:
> >
> > On Wed, Dec 17, 2025 at 10:11:58AM +0530, vignesh C wrote:
> >> The attached v3 version patch has the changes for the same.
> >
> > The "tag" variable needed a change to compensate for the subrinfo->dobj.name
> > change. I plan to push the attached version.
> > <DO_SUBSCRIPTION_REL-v4.patch>
>
> v4 looks solid. A couple of nitpicks:
>
> 1
> ```
> + SubRelInfo *srobj1 = *(SubRelInfo *const *) p1;
> + SubRelInfo *srobj2 = *(SubRelInfo *const *) p2;
> ```
>
> These two temp pointers can be const, like:
> ```
> const SubRelInfo *srobj1 = *(SubRelInfo *const *) p1;
> const SubRelInfo *srobj2 = *(SubRelInfo *const *) p2;
> ```

I felt the way it is handled in the patch is ok and consistent with
the other variables used in this function.

> 2
> ```
> + /* Sort by subscription name, since (namespace, name) match the rel */
> ```
>
> This comment is correct, but sounds a little insider-ish. Maybe:
>
> /* Tiebreak by subscription name; (namespace, name) already identify the table */

Similarly here too, it is inline with similar comments of other enums
in this function.

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2025-12-18 12:11:24 Re: Newly created replication slot may be invalidated by checkpoint
Previous Message vignesh C 2025-12-18 12:00:12 Re: Logical Replication of sequences