Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d80hO-0002Uk-3Y for pgsql-hackers@arkaria.postgresql.org; Tue, 09 May 2017 08:40:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d80hN-0000Wy-Ke for pgsql-hackers@arkaria.postgresql.org; Tue, 09 May 2017 08:40:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d80fr-00069o-Nu for pgsql-hackers@postgresql.org; Tue, 09 May 2017 08:39:15 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d80fp-0007tG-48 for pgsql-hackers@postgresql.org; Tue, 09 May 2017 08:39:14 +0000 Received: by mail-wm0-x22e.google.com with SMTP id m123so91869986wma.0 for ; Tue, 09 May 2017 01:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=B02U0DvHLXf0H8r1NubtFtz2XIXUzFhuRIPt9iu77K0=; b=1kaJCegCnwwfPmWf4UyWOYN3C+F9J0Lc+6xCqE7cJzvu1rxLmTPE5H+xm3t91yUcN7 qe802KV7IXwPplnOxDN/eRZfLbSDIOETfhMTyK2Qy0XHjJmZ/yrtoBFTY7RY/floCADT xKJf9ONW1pF0PrfB3AaxFxJPXQoxm1bwxeLwnMUsJfGYnAp34GZ5xWHqlwEqqbekDs0z /rUH31pg0/lEqC+DtlPJ+Nt6ZhSJUQU6XLbaig3NxJPBYyLETHE4LiUwHDytbAnyyhmE oJMI9s1r6/eo+O/6HJldcGVzPmi2k/nICWjSZCDN2zQAjWE6PhAB6zscMs179ylcmkTx VyQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=B02U0DvHLXf0H8r1NubtFtz2XIXUzFhuRIPt9iu77K0=; b=DZTKbmbbZCD08vNHPQ9vJoZh9NMY1CbM0j14Lp3u0BZ2vlN/C8yx7BHgO6WWeEqU/M QFL9o02SeIfSvcU3C8qqubcuwRNcZcPNhoIH0QnNX4xWB+nwSYHzOmSnrrWOW8iXfGoM xLPOkroqptC5Qnlia2YBR21BtNIFNw/MZEeYjoiZSrcHBmvP6/lKLSc50SpaHBJRN333 ThEbLW5UWEF+sr5ZXhJxU+y/OGE7Agha6Q+5tMrRYSURtB8U2LNtv1yca6dTMuyw9MUR MoBrhAV2hVI9XnrY0AzX9MJICa9NagwfUK+T2Qa6VQsQEoB5zJyPktaA5s27vYWpg24T YvpQ== X-Gm-Message-State: AODbwcAOXWUmUSJoghvNOGRU+c3jXtuoeTdyhwdTRFHQ/lZfnP3pp8T+ XBXHsPQ6sw058UlXPpnoOifgK6y40QCRUErvWgwTqz4e4SQk3WfgzHNjImA6A9CKw5nkExGmN8K Y5lhsV293V+Q3RgSDMZV2VGQnjssn5v9o2KJY+QiFPTYE6MDeU6H4967FnaMIiSblvswo2e25 X-Received: by 10.28.138.209 with SMTP id m200mr1836906wmd.8.1494319151343; Tue, 09 May 2017 01:39:11 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id p17sm15898536wmd.11.2017.05.09.01.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 01:39:10 -0700 (PDT) Subject: Re: logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling) To: Peter Eisentraut , 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> Cc: Robert Haas , Michael Paquier , PostgreSQL mailing lists From: Petr Jelinek Message-ID: <5f6ad263-af87-2aee-b86b-8bf7e3260b73@2ndquadrant.com> Date: Tue, 9 May 2017 10:39:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <35f3592b-8582-e348-1823-f8edfcf03ba3@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 09/05/17 07:07, Peter Eisentraut wrote: > On 5/8/17 23:23, Peter Eisentraut wrote: >> The way this uses RESTRICT and CASCADE appears to be backwards from its >> usual meaning. Normally, CASCADE when dropping an object that is still >> used by others will cause those other objects to be dropped. The >> equivalent here would be DROP REPLICATION SLOT + CASCADE would drop the >> subscription. >> >> 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. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, 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