Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Arseny Sher <a(dot)sher(at)postgrespro(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Date: 2017-09-14 19:04:54
Message-ID: 7492416f-2e61-d875-6179-ea719f5e5238@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(dot)eisentraut(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-09-14 19:06:24 Re: DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Previous Message Peter Eisentraut 2017-09-14 18:56:22 Re: taking stdbool.h into use