Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8699-0008W8-0k for pgsql-hackers@arkaria.postgresql.org; Tue, 09 May 2017 14:29:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8698-0002lD-9m for pgsql-hackers@arkaria.postgresql.org; Tue, 09 May 2017 14:29:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d867U-0007Wk-UL for pgsql-hackers@postgresql.org; Tue, 09 May 2017 14:28:09 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d867R-0006dL-2p for pgsql-hackers@postgresql.org; Tue, 09 May 2017 14:28:08 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2743520C87; Tue, 9 May 2017 10:28:03 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 09 May 2017 10:28:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=8DA+808epZyVJ4H1nHMY8pU9ift+IXoTbwhWgVbx7LU=; b=St0/FHXG rKVGS7wGZuxHJDs2rJPlQHGqbXpr4m7Q0BpOqx+wRSPKGxHgrb+3ADlwlXxr8yhC d4ECrs8PT3N9qsKbmm/FmclhtgOlCYESj5u7oFa5Uv0noYZMFS1DaQbGc6IVDs1U WRGCyTdN2yJotu3sQfJkxIOCd98PKSlOIaYmqV/oHHSkoGxHnrh16xV/bc76CJNo FB+uXOAxPSgmGNhr/kMKxttFounM+8o+po6/Zqlg8vSFoF/cdXSATi1GziltBq3c AvzRdQoGXRF4R+jlUtKZHxYGlZgfiim11JV4XCaY9aoRWNARC2KCRFv+4+4K3ZGc w8z7aLRG5l3FYw== X-ME-Sender: X-Sasl-enc: JFwl4k7t60QUE0nuJPbUdIaM7tD81Ti7exBHLbWRfAW2 1494340082 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id C635C246E7; Tue, 9 May 2017 10:28:02 -0400 (EDT) Subject: Re: logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling) To: Petr Jelinek , Tom Lane References: <27478.1493727233@sss.pgh.pa.us> <29431.1493730652@sss.pgh.pa.us> <360a1932-7af4-609b-94f1-2ad419430869@2ndquadrant.com> <9174dc31-787a-a2f6-818f-cb4a5c1dfddb@2ndquadrant.com> <30166.1493731904@sss.pgh.pa.us> <2b931e0e-d9f2-c79e-b74b-91df2f915e66@2ndquadrant.com> <96e95255-94d9-0881-16ba-bdb6d05bb307@2ndquadrant.com> <52a1f160-db1f-49c6-9832-498dbea58ae8@2ndquadrant.com> <35f3592b-8582-e348-1823-f8edfcf03ba3@2ndquadrant.com> <5f6ad263-af87-2aee-b86b-8bf7e3260b73@2ndquadrant.com> Cc: Robert Haas , Michael Paquier , PostgreSQL mailing lists From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Tue, 9 May 2017 10:28:02 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <5f6ad263-af87-2aee-b86b-8bf7e3260b73@2ndquadrant.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 5/9/17 04:39, Petr Jelinek wrote: >>> What we want to simulate instead is an "auto" dependency of the slot on >>> the subscription. So you can drop the slot separately (subject to other >>> restrictions), and it is dropped automatically when the subscription is >>> dropped. To avoid that, you can disassociate the slot from the >>> subscription, which you have implemented. >>> >>> I think we can therefore do without RESTRICT/CASCADE here. If a slot is >>> associated with the subscription, it should be there when we drop the >>> subscription. Otherwise, the user has to disassociate the slot and take >>> care of it manually. So just keep the "cascade" behavior. >>> >>> Similarly, I wouldn't check first whether the slot exists. If the >>> subscription is associated with the slot, it should be there. >> >> Here is your patch amended for that. > > I am fine with this mechanism as well. Committed. I also wrote a bit of documentation about slot handling for subscriptions, covering some of what was discussed in this thread. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers