Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling) - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)
Date
Msg-id 360a1932-7af4-609b-94f1-2ad419430869@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
List pgsql-hackers
On 02/05/17 15:10, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>>> On Thu, Apr 20, 2017 at 7:46 AM, Petr Jelinek
>>> <petr.jelinek@2ndquadrant.com> wrote:
>>>> DROP SUBSCRIPTION mysub NODROP SLOT;
> 
>>> I'm pretty uninspired by this choice of syntax.
> 
> Actually, this command has got much worse problems than whether you like
> the spelling of its option: it shouldn't have an option in the first
> place.  I put it to you as an inviolable rule that no object DROP command
> should ever have any options other than RESTRICT/CASCADE and IF EXISTS.
> If it does, then you don't know what to do when the object is recursed
> to by a cascaded drop.
> 
> It's possible that we could allow exceptions to this rule for object types
> that can never have any dependencies.  But a subscription doesn't qualify
> --- it's got an owner, so DROP OWNED BY already poses this problem.  Looks
> to me like it's got a dependency on a database, too.  (BTW, if
> subscriptions are per-database, why is pg_subscription a shared catalog?
> There were some pretty schizophrenic decisions here.)

Because otherwise we would need launcher process per database, not pretty.

> 
> So ISTM we need to get rid of the above-depicted syntax.  We could instead
> have what-to-do-with-the-slot as a property of the subscription,
> established at CREATE SUBSCRIPTION and possibly changed later by ALTER
> SUBSCRIPTION.  Not quite sure what to call the option, maybe something
> based on the concept of the subscription "owning" the slot.
> 

So what do you do if the upstream does not exist anymore when you are
dropping subscription?

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] logical replication syntax (was DROP SUBSCRIPTION,query cancellations and slot handling)