Re: Add common function ReplicationOriginName. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Add common function ReplicationOriginName.
Date
Msg-id CAA4eK1J0MbqLEkg277RqeVPoB24Ky+cctbVVm2RC5uTB92qH7A@mail.gmail.com
Whole thread Raw
In response to Re: Add common function ReplicationOriginName.  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Add common function ReplicationOriginName.
List pgsql-hackers
On Wed, Sep 21, 2022 at 3:09 PM Peter Smith <smithpb2250@gmail.com> wrote:
>
> On Wed, Sep 21, 2022 at 3:23 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> ...
>
> > Can't we use the existing function ReplicationOriginNameForTablesync()
> > by passing relid as InvalidOid for this purpose? We need a check
> > inside to decide which name to construct, otherwise, it should be
> > fine. If we agree with this, then we can change the name of the
> > function to something like ReplicationOriginNameForLogicalRep or
> > ReplicationOriginNameForLogicalRepWorkers.
> >
>
> This suggestion attaches special meaning to the reild param.
>
> Won't it seem a bit strange for the non-tablesync callers (who
> probably have a perfectly valid 'relid') to have to pass an InvalidOid
> relid just so they can format the correct origin name?
>

For non-tablesync workers, relid should always be InvalidOid. See, how
we launch apply workers in ApplyLauncherMain(). Do you see any case
for non-tablesync workers where relid is not InvalidOid?


-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Tighten pg_get_object_address argument checking
Next
From: Dilip Kumar
Date:
Subject: Re: making relfilenodes 56 bits