Re: Handle infinite recursion in logical replication setup

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>
Subject: Re: Handle infinite recursion in logical replication setup
Date: 2022-07-18 16:16:37
Message-ID: CALDaNm3sBNyTov4qWzMoXy2612dyrxF+9eAdpQeVV9bS3mD22g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 18, 2022 at 4:58 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Mon, Jul 18, 2022 at 10:23 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Sat, Jul 16, 2022 at 10:29 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > >
> > > I think giving two options would be really confusing from the
> > > usability perspective. I think what we should be doing here is to
> > > keep these three names 'none', 'any' and 'local' as reserved names for
> > > the origin name so that those are not allowed to be set by the user
> > > and they have some internal meaning.
> > >
> >
> > This makes sense to me. I think we can avoid reserving 'local' for now
> > till we agree on its use case and implementation. One similar point
> > about slots is that we treat 'none' slot_name in subscription commands
> > as a special value indicating no slot name whereas we do allow
> > creating a slot with the name 'none' with
> > pg_create_logical_replication_slot(). So, if we want to follow a
> > similar convention here, we may not need to add any restriction for
> > origin names but personally, I think it is better to add such a
> > restriction to avoid confusion and in fact, as a separate patch we
> > should even disallow creating slot name as 'none'.
>
> I have made changes to disallow the name "any" and "none" in
> pg_replication_origin_create. The attached v34 patch has the changes
> for the same. I will post a separate patch to disallow creation of
> slots with names as 'none' separately later.

I have updated the patch to handle the origin value case
insensitively. The attached patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v34-0003-Document-bidirectional-logical-replication-steps.patch text/x-patch 13.7 KB
v34-0001-Skip-replication-of-data-having-origin.patch text/x-patch 61.5 KB
v34-0002-Check-and-throw-an-error-if-publication-tables-w.patch text/x-patch 43.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-07-18 16:36:19 Re: Costing elided SubqueryScans more nearly correctly
Previous Message Tom Lane 2022-07-18 16:08:24 Convert planner's AggInfo and AggTransInfo to Nodes