pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arseny Sher <a.sher@postgrespro.ru>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org, Masahiko Sawada <sawada.mshk@gmail.com>
Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Date: Thu, 14 Sep 2017 22:47:20 +0300
Message-ID: <87o9qd6p13.fsf@ars-thinkpad> (raw)
In-Reply-To: <c523d4e6-d082-a8b2-e728-7ede1f2fef3a@2ndquadrant.com>
References: <87mv6av84w.fsf@ars-thinkpad>
	<48b251c6-0652-c131-975a-835d8cdb003c@2ndquadrant.com>
	<10937.1505245906@sss.pgh.pa.us>
	<87shfqsw22.fsf@ars-thinkpad>
	<c523d4e6-d082-a8b2-e728-7ede1f2fef3a@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> 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



view thread (32+ messages)  latest in thread

Message-ID: <87o9qd6p13.fsf@ars-thinkpad>
Permalink:  ../87o9qd6p13.fsf@ars-thinkpad/
Also on:    postgresql.org/message-id/87o9qd6p13.fsf@ars-thinkpad

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: a.sher@postgrespro.ru, peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, sawada.mshk@gmail.com
  Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
  In-Reply-To: <87o9qd6p13.fsf@ars-thinkpad>
  References: <87mv6av84w.fsf@ars-thinkpad> <48b251c6-0652-c131-975a-835d8cdb003c@2ndquadrant.com> <10937.1505245906@sss.pgh.pa.us> <87shfqsw22.fsf@ars-thinkpad> <c523d4e6-d082-a8b2-e728-7ede1f2fef3a@2ndquadrant.com> <87o9qd6p13.fsf@ars-thinkpad>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox