Re: BUG #19975: ALTER SUBSCRIPTION ... SET (slot_name, failover) updates the old slot

From: Ishjaap Singh <ishjaap(dot)singh07(at)gmail(dot)com>
To: rushsky518(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19975: ALTER SUBSCRIPTION ... SET (slot_name, failover) updates the old slot
Date: 2026-12-06 12:36:49
Message-ID: CA+Y2Bme1K_qVOwa79_kKpcs2OHZ4gpgJu6OWj6rCWa2H5SK9Gw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

I reproduced this on master (8d90516d76d). It also happens the other
way round: if the old slot has failover = true, SET (slot_name =
'new_slot', failover = false) clears it on the old slot and leaves
new_slot as it was.

The attached patch does what you suggested and rejects the combination,
with the same error we already give for slot_name and two_phase. It
adds a regression test in subscription.sql, which fails without the
fix. make check and the subscription and recovery/040 TAP tests pass.
Setting the two options in separate commands still works.

This came up when the two_phase check went in. Amit noted that
failover has the same problem, and Kuroda-san agreed but kept it out
of that patch [1].

The patch applies to master, REL_19_STABLE and REL_18_STABLE, and I
tested it on 18 as well. 17 has the same bug, but the code there is
laid out differently, so it would need its own version. I can post
that if wanted.

Regards,
Ishjaap Singh

[1] https://www.postgresql.org/message-id/OSBPR01MB255200509B265ABE1B210E67F5DB2%40OSBPR01MB2552.jpnprd01.prod.outlook.com

Attachment Content-Type Size
v1-0001-Disallow-altering-slot_name-and-failover-at-the-s.patch application/octet-stream 3.3 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Raja Sai pranav 2026-12-06 04:41:52 Re: BUG #19790: "cannot start a subtransaction ... inval messages" after "ALTER DOMAIN ... DROP CONSTRAINT"