Re: Refactor to make use of a common function for GetSubscriptionRelations and GetSubscriptionNotReadyRelations.

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Refactor to make use of a common function for GetSubscriptionRelations and GetSubscriptionNotReadyRelations.
Date: 2022-07-24 16:22:16
Message-ID: CALDaNm3Hk2HCq5wgX7_7hXhwtWOri82ARAOBJy7HyyZbou5GTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 22, 2022 at 11:11 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Fri, Jul 22, 2022 at 3:47 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > I was in favour of enum mostly because I thought the bitmask of an
> > earlier patch was mis-used; IMO each bit should only be for
> > representing something as "on/set". So a bit for
> > SUBSCRIPTION_REL_STATE_READY makes sense, but a bit for
> > SUBSCRIPTION_REL_STATE_NOT_READY seemed strange/backwards to me. YMMV.
> >
> > So using a bitmask is fine, except I thought it should be implemented
> > so that one of the bits is for a "NOT" modifier (IIUC this is kind of
> > similar to what Michael [1] suggested above?). So "Not READY" would be
> > (SUBSCRIPTION_REL_STATE_MOD_NOT | SUBSCRIPTION_REL_STATE_READY)
> >
>
> Hmm, I think that sounds more complicated than what I expected. I
> suggest let's go with a simple idea of using a boolean not_ready which
> will decide whether to use the additional key to search. I feel we can
> extend it by using a bitmask or enum when we have a clear need for
> more states.

Thanks for the comments, i have modified it by changing it to a
boolean parameter. The attached v4 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v4-0001-Refactor-to-make-use-of-a-common-function-for-Get.patch text/x-patch 5.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-07-24 16:27:07 fairywren hung in pg_basebackup tests
Previous Message Erik Rijkers 2022-07-24 13:39:32 Re: Schema variables - new implementation for Postgres 15