Re: Proposal: Conflict log history table for Logical Replication

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Zhijie Hou <houzhijie22(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-11-26 03:37:15
Message-ID: CAJpy0uD-Jt=GG_dOsWKevc5qFxCD7f71HT3my=UWbkgHJu_9pA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 26, 2026 at 8:55 AM Zhijie Hou <houzhijie22(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Wed, Nov25, 2026 at 10:56 PM vignesh C wrote:
> > On Wed, 25 Nov 2026 at 17:23, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
> > >
> > > Attached v2 patch fixing above as well as other comments from Hou-san at [2].
> >
> > Thanks for the updated patch, one comment:
> > With this change, setting conflict_log_destination to log in ALTER
> > SUBSCRIPTION will fail with an inappropriate hint: "Use DROP ...
> > CASCADE to drop the dependent objects too". This hint is misleading
> > because ALTER SUBSCRIPTION does not support CASCADE(it is ok in drop
> > subscription case):
> >
> > ...
> > postgres=# alter subscription sub1 set (conflict_log_destination = log);
> > ERROR: cannot drop table pg_conflict.pg_conflict_log_16392 because
> > other objects depend on it
> > DETAIL: view v1 depends on table pg_conflict.pg_conflict_log_16392
> > HINT: Use DROP ... CASCADE to drop the dependent objects too.
> >
> IIUC, the hint comes unconditionally from reportDependentObjects() for
> any DROP_RESTRICT deletion, and other commands without CASCADE support
> already show the same hint, e.g., ALTER TABLE ... ALTER COLUMN ... DROP
> IDENTITY, ALTER TABLE ... ALTER COLUMN ... TYPE, and DROP INDEX
> CONCURRENTLY (similarly, ALTER GROUP ... DROP USER emits "Use CASCADE to
> revoke them too.")
>
> Improving it might require teaching the dependency machinery (e.g.,
> maybe via a new PERFORM_DELETION_* flag) whether the caller supports
> CASCADE, so I think we could consider it as a separate improvement.

The patch shared by Kuroda-San seems like a simple fix, since it
directly impacts our conflict_log_destination change, should we take
it along with this patch? Thoughts?

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Lukas Fittl 2026-11-26 04:11:53 Re: Reducing output size of nodeToString
Previous Message Hayato Kuroda (Fujitsu) 2026-11-26 03:33:33 RE: Proposal: Conflict log history table for Logical Replication