Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsa8E-0004z3-SS for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Sep 2017 19:49:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dsa8E-0002sS-F6 for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Sep 2017 19:49:02 +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 1dsa6d-0005IA-NI for pgsql-hackers@postgresql.org; Thu, 14 Sep 2017 19:47:23 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsa6b-00088X-4u for pgsql-hackers@postgresql.org; Thu, 14 Sep 2017 19:47:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 36CB921C1D04; Thu, 14 Sep 2017 22:47:20 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from ars-thinkpad (broadband-77-37-166-201.moscow.rt.ru [77.37.166.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id AC2AC21C0917; Thu, 14 Sep 2017 22:47:19 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1505418439; bh=/ppePTe5N9Vl6J6l5QJmLXLLuiM5/vGRm7G4AnPjlfo=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=QSk2zaMVeXqwRfqkIgIU1hLKAnT3kZ4eDHkvCegQByY9pCH8p9MyZgSP/ZTuqo+x/ VRN3ZI6cowWX6m/+BDY60E8RJCWGPoHi7VdWfeY1x0+j73+QQzLh3s9O59bMzbMTrW 4qa0KTVRJaaw+syGqive2RycXESIu//vczFQ/oGI= From: Arseny Sher To: Peter Eisentraut Cc: Tom Lane , pgsql-hackers@postgresql.org, Masahiko Sawada Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction References: <87mv6av84w.fsf@ars-thinkpad> <48b251c6-0652-c131-975a-835d8cdb003c@2ndquadrant.com> <10937.1505245906@sss.pgh.pa.us> <87shfqsw22.fsf@ars-thinkpad> Date: Thu, 14 Sep 2017 22:47:20 +0300 In-Reply-To: (Peter Eisentraut's message of "Thu, 14 Sep 2017 15:06:24 -0400") Message-ID: <87o9qd6p13.fsf@ars-thinkpad> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 Peter Eisentraut writes: > On 9/13/17 07:00, Arseny Sher wrote: >> On the other hand, forbidding to execute disable sub and drop sub in one >> transaction makes it impossible e.g. to drop subscription in trigger > > Disabling a subscription before dropping it isn't very useful, is it? > So I'm not sure this is an important use case we need to optimize. We > just need to prevent it from hanging. Not quite so. Currently it is forbidded to set subscription's slot to NONE on enabled sub, and the only way to drop sub without touching the slot is to run ALTER SUBSCRIPTION SET (SLOT_NAME = NONE) beforehand. Practically this means that we have to go through disable sub -> alter sub -> drop sub pipeline if we want to left the slot alone or just would like to drop sub in transaction block -- with replication slot set the latter is impossible. -- Arseny Sher -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers