Re: Disabling an index temporarily - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Disabling an index temporarily
Date
Msg-id 566BFE82.5010401@dalibo.com
Whole thread Raw
In response to Re: Disabling an index temporarily  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Responses Re: Disabling an index temporarily  (Tatsuo Ishii <ishii@postgresql.org>)
List pgsql-hackers
On 12/12/2015 11:42, Albe Laurenz wrote:
> Tatsuo Ishii wrote:
>>> Wouldn't something like:
>>>
>>> ALTER INDEX foo SET DISABLED;
>>>
>>> See more in line with our grammar?
>>
>> But this will affect other sessions, no?
> 
> Not if it is used in a transaction that ends with a ROLLBACK,
> but then you might as well use DROP INDEX, except
> that DROP INDEX takes an access exclusive lock.
> 
> Yours,
> Laurenz Albe
> 

Oleg and Teodor announced some time ago an extension for this exact use
case, see
http://www.postgresql.org/message-id/Pine.LNX.4.64.0910062354510.6801@sn.sai.msu.ru

This also has the advantage of not needing an exclusive lock on the index.


-- 
Julien Rouhaud
http://dalibo.com - http://dalibo.org



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Logical replication and multimaster
Next
From: Tatsuo Ishii
Date:
Subject: Re: Disabling an index temporarily