Proposal: pg_createsubscriber use without superuser privileges

Started by Zane Duffield10 months ago3 messageshackers

Thread notes

1 note#feature#moderate#enhancement
hackorum-bot#feature#moderate#enhancement
hackorum-bot
1 day ago

@global #feature #moderate #enhancement

#feature#moderate#enhancement
Jump to latest
#1Zane Duffield
duffieldzane@gmail.com

Currently, in order to use pg_createsubscriber you must have superuser
privileges on the source database.

This requires stems from the use of FOR ALL TABLES
<https://www.postgresql.org/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES>
in
the CREATE PUBLICATION command used. As far as I am aware, none of the
other steps performed on the source server require superuser.
I wonder whether pg_createsubscriber could be extended to use an existing
publication, after confirming that it is equivalent to the one it would
have created itself.

In my use case for pg_createsubscriber, I would prefer not to give the
downstream server superuser privileges, since it wouldn't need them for any
other reason.

I could probably contribute this feature myself, if it is agreeable.

Thanks,
Zane

#2Hayato Kuroda (Fujitsu)
kuroda.hayato@fujitsu.com
In reply to: Zane Duffield (#1)
RE: Proposal: pg_createsubscriber use without superuser privileges

Dear Zane,

Thanks for the proposal! Your voice is always welcomed.

I wonder whether pg_createsubscriber could be extended to use an existing
publication, after confirming that it is equivalent to the one it would have
created itself.

I did not fully confirm your point, but I feel the commit [1]https://github.com/postgres/postgres/commit/85ddcc2f4cdef490276d151c80459e287bceb782 allowed us to
re-use the existing publications. Can you try with the development version of PG
and check whether it satisfies your needs?

[1]: https://github.com/postgres/postgres/commit/85ddcc2f4cdef490276d151c80459e287bceb782

Best regards,
Hayato Kuroda
FUJITSU LIMITED

#3Zane Duffield
duffieldzane@gmail.com
In reply to: Hayato Kuroda (Fujitsu) (#2)
Re: Proposal: pg_createsubscriber use without superuser privileges

Thanks, Hayato-san.
I should have checked the devel documentation before mailing in, because
that new feature would satisfy my needs.

On Wed, Feb 4, 2026 at 2:33 PM Hayato Kuroda (Fujitsu) <
kuroda.hayato@fujitsu.com> wrote:

Show quoted text

Dear Zane,

Thanks for the proposal! Your voice is always welcomed.

I wonder whether pg_createsubscriber could be extended to use an existing
publication, after confirming that it is equivalent to the one it would

have

created itself.

I did not fully confirm your point, but I feel the commit [1] allowed us to
re-use the existing publications. Can you try with the development version
of PG
and check whether it satisfies your needs?

[1]:
https://github.com/postgres/postgres/commit/85ddcc2f4cdef490276d151c80459e287bceb782

Best regards,
Hayato Kuroda
FUJITSU LIMITED