Validate SERVER subscription conninfo during ALTER SUBSCRIPTION ... OWNER TO

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Validate SERVER subscription conninfo during ALTER SUBSCRIPTION ... OWNER TO
Date: 2026-07-18 15:41:26
Message-ID: CAHGQGwFGa6+wWVgUmZPFwN=fBY59mYPkMK3=TxT=Pv5C1mNNRQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While tryng the new v19 feature CREATE/ALTER SUBSCRIPTION ... SERVER,
I found that ALTER SUBSCRIPTION ... OWNER TO can change the effective
conninfo for a SERVER subscription, but does not validate the new owner's
generated conninfo with walrcv_check_conninfo().

As a result, the owner of a SERVER subscription with password_required=true
can be changed to a non-superuser whose generated connection string does not
contain a password. The ownership change succeeds, but the subscription is
left in a state that will fail later when a worker or another command tries to
connect.

Isn't this problematic?

The attached patch fixes this by making ALTER SUBSCRIPTION ... OWNER TO
validate the new owner's generated conninfo with walrcv_check_conninfo().
It also updates the ALTER SUBSCRIPTION documentation to mention
the SERVER-specific requirements for changing the owner.

Thought?

Regards,

--
Fujii Masao

Attachment Content-Type Size
v1-0001-Validate-subscription-conninfo-on-owner-change.patch application/octet-stream 8.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2026-07-18 16:00:09 Re: Bug in asynchronous Append
Previous Message vignesh C 2026-07-18 14:40:13 Re: sequencesync worker race with REFRESH SEQUENCES