| From: | Neil Conway <neilc(at)samurai(dot)com> |
|---|---|
| To: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
| Cc: | "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Async commands (like drop index) |
| Date: | 2007-05-18 17:39:56 |
| Message-ID: | 1179509996.6059.8.camel@goldbach |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jim C. Nasby | 2007-05-18 19:20:24 | Re: Async commands (like drop index) |
| Previous Message | Alvaro Herrera | 2007-05-18 17:29:35 | Re: Async commands (like drop index) |