From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Arseny Sher <a.sher@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org
Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Date: Thu, 14 Sep 2017 15:04:54 -0400
Message-ID: <7492416f-2e61-d875-6179-ea719f5e5238@2ndquadrant.com> (raw)
In-Reply-To: <20170914122339.gboxwprodgqtaiu3@alvherre.pgsql>
References: <20170914122339.gboxwprodgqtaiu3@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 9/14/17 08:23, Alvaro Herrera wrote:
> Peter Eisentraut wrote:
>> On 9/13/17 09:56, Alvaro Herrera wrote:
>>> Tom Lane wrote:
>>>> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>>>
>>>>> - Disallow DROP SUBSCRIPTION in a transaction under certain
>>>>> circumstances, for example if a transaction has previously manipulated
>>>>> the same subscription.
>>>
>>>> ISTM the second of those (refuse to drop an in-use subscription) is
>>>> by far the least surprising behavior.
>>>
>>> +1 for that option. IIRC this has precedent for other object types such
>>> as tables, where we refuse some action if we have already operated on
>>> the table in the same transaction.
>>
>> What are some examples of such behavior?
>
> Search for CheckTableNotInUse() callers.
That one uses the relcache refcount, so we can't use that mechanism
here. I think we need something based on xmin. The enum code has
something like it, but I don't understand the details.
--
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
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: peter.eisentraut@2ndquadrant.com, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, a.sher@postgrespro.ru
Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
In-Reply-To: <7492416f-2e61-d875-6179-ea719f5e5238@2ndquadrant.com>
References: <20170914122339.gboxwprodgqtaiu3@alvherre.pgsql> <7492416f-2e61-d875-6179-ea719f5e5238@2ndquadrant.com>
* 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