]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Validate subscription conninfo on owner change master github/master
authorFujii Masao <fujii@postgresql.org>
Thu, 23 Jul 2026 10:24:55 +0000 (19:24 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 23 Jul 2026 10:24:55 +0000 (19:24 +0900)
commit1c9c35890421e96a91129b51f2c6446a6d95af95
tree3cc501caf4417ff24fd37df988cb96d8a7fca669
parent937db82a8d6ffb1b3bb292ed7070dae33aa659ba
Validate subscription conninfo on owner change

For subscriptions using SERVER, changing the owner can change the
effective connection string. However, ALTER SUBSCRIPTION ... OWNER TO
did not validate the generated conninfo for the new owner.

As a result, ownership could be transferred to a non-superuser whose
generated connection string did not satisfy password_required=true.
The ownership change succeeded, but the subscription would fail later
when the worker or another command tried to connect.

Fix this by making ALTER SUBSCRIPTION ... OWNER TO validate the new
owner's generated conninfo with walrcv_check_conninfo().

Backpatch to v19, where SERVER subscriptions were introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Yuanchao Zhang <145zhangyc@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Discussion: https://postgr.es/m/CAHGQGwFGa6+wWVgUmZPFwN=fBY59mYPkMK3=TxT=Pv5C1mNNRQ@mail.gmail.com
Backpatch-through: 19
doc/src/sgml/ref/alter_subscription.sgml
src/backend/commands/subscriptioncmds.c
src/test/regress/expected/subscription.out
src/test/regress/regress.c
src/test/regress/sql/subscription.sql