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



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to