Re: Async commands (like drop index) - Mailing list pgsql-hackers

From Neil Conway
Subject Re: Async commands (like drop index)
Date
Msg-id 1179509996.6059.8.camel@goldbach
Whole thread Raw
In response to Re: Async commands (like drop index)  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Async commands (like drop index)  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-hackers
On Fri, 2007-18-05 at 13:29 -0400, Alvaro Herrera wrote:
> I think what Joshua really wants is an equivalent of this

That's not what his original email asked for, at any rate.

> start:
>     BEGIN;
>     LOCK TABLE foo IN ACCESS EXCLUSIVE MODE NOWAIT;
>     -- if fail, rollback and go to start
>     DROP INDEX foo_idx;
>     COMMIT;
> 
> The idea is that the lock is only acquired if immediately available,
> thus not blocking other queries which would otherwise be blocked behind
> the DROP INDEX.

ISTM this can easily be implemented with statement_timeout (which is
more general to boot).

-Neil




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Async commands (like drop index)
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Async commands (like drop index)