Re: Logical Replication of sequences - Mailing list pgsql-hackers

From Nisha Moond
Subject Re: Logical Replication of sequences
Date
Msg-id CABdArM7aY+u5Fv9KMHp_iX=AEixfDum5e2ixZkWS8YcOt_NO7Q@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
On Wed, Aug 6, 2025 at 2:28 PM vignesh C <vignesh21@gmail.com> wrote:
>
>
> The attached v20250806 version patch has the changes for the same.
>
Thank You for the patches.

patch-0005: sequencesync.c
+ aclresult = pg_class_aclcheck(RelationGetRelid(sequence_rel), GetUserId(),
+   ACL_UPDATE);
+ if (aclresult != ACLCHECK_OK)
+ aclcheck_error(aclresult,
+    get_relkind_objtype(sequence_rel->rd_rel->relkind),
+    seqname);

I see that the run_as_owner check has been removed from
LogicalRepSyncSequences() and added to copy_sequences() for the
SetSequence() call.

However, IIUC, the same check is also needed in
LogicalRepSyncSequences(). Currently, the sequencesync worker can fail
in the above permission check since user switching doesn’t happen when
run_as_owner is false.

```
ERROR:  permission denied for sequence n1
```
Should we add the run_as_owner handling here as well to avoid this?

--
Thanks,
Nisha



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: cpluspluscheck vs ICU again
Next
From: Shlok Kyal
Date:
Subject: Re: Skipping schema changes in publication