Re: Async commands (like drop index)

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Async commands (like drop index)
Дата
Msg-id 20070518192024.GB14548@nasby.net
обсуждение исходный текст
Ответ на Re: Async commands (like drop index)  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
On Fri, May 18, 2007 at 01:39:56PM -0400, Neil Conway wrote:
> 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).

Well, with statement_timeout, and writing a function...

This functionality would actually be useful, but I'm not sure if it's
worth including in core. It would be really nice to have an example of
how to do this in a PostgreSQL Cookbook somewhere though.
-- 
Jim Nasby                                      decibel@decibel.org
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: Async commands (like drop index)
Следующее
От: Ron Mayer
Дата:
Сообщение: Idea that might inspire more patch reviewing.