Re: Proposal: Conflict log history table for Logical Replication - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Proposal: Conflict log history table for Logical Replication
Date
Msg-id CAA4eK1KDc3vfVsbo_yLZtmMFY84j4QaVT9vHetYL-TQ=+_536Q@mail.gmail.com
Whole thread
In response to Re: Proposal: Conflict log history table for Logical Replication  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On Fri, May 29, 2026 at 2:23 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Thu, May 28, 2026 at 2:57 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
>   I think I am facing a
> > related problem w.r.t newly created subscription. After applying first
> > six patches, the create subscription fails as follows:
> > postgres=# create subscription sub1 connection 'dbname=postgres'
> > publication pub1 with (conflict_log_destination='all');
> > ERROR:  dependent subscription was concurrently dropped
> >
> > I debugged and found that we get the above ERROR when we are trying to
> > find the subscription which is not yet created. In this case, it seems
> > to be happening because we are using a subscription that is yet not
> > created for dependency recording. This raises a question as to why are
> > we creating the conflict_log_table before subscription, at least this
> > needs some comments.
>
> This error occurs because in the commit below [1], we disallowed
> recording a dependency on an object that does not exist. Therefore, we
> now need to record the dependency after the subscription is created.
>

But don't we normally create dependency immediately after creating the
object? Do you see such examples at other places in the code?

> And we create CLT before so that we can add the conflict log relid in
> pg_subscription without an additional update,
>

But will this additional update matter to an extent in DDL execution
that we don't follow our usual way to record dependency? I feel unless
we follow similar coding pattern at other places, it is better to
create the CLT after subscription.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: A few message wording/formatting cleanup patches
Next
From: Jacob Champion
Date:
Subject: Re: PSA: Planning to grease protocol connections during 19beta