Re: DROP SUBSCRIPTION with no slot

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DROP SUBSCRIPTION with no slot
Date: 2019-09-24 21:25:12
Message-ID: f5d48b96-f135-efad-a1d1-369984c7d18b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-09-24 16:31, Jeff Janes wrote:
> I recently had to cut loose (pg_drop_replication_slot) a logical replica
> that couldn't keep up and so was threatening to bring down the master.
>
> In mopping up on the replica side, I couldn't just drop the
> subscription, because it couldn't drop the nonexistent slot on the
> master and so refused to work.  So I had to do a silly little dance
> where I first disable the subscription, then ALTER SUBSCRIPTION ... SET
> (slot_name = NONE), then drop it.
>
> Wanting to clean up after itself is admirable, but if there is nothing
> to clean up, why should that be an error condition?

The alternatives seem quite error prone to me. Better be explicit.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2019-09-24 21:26:27 Release 11 of PostgreSQL Buildfarm client
Previous Message Tom Lane 2019-09-24 21:14:50 Improving on MAX_CONVERSION_GROWTH