Re: update functions locking tables

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: update functions locking tables
Дата
Msg-id 20050830125341.GA56245@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: update functions locking tables  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Ответы Re: update functions locking tables  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Список pgsql-general
On Tue, Aug 30, 2005 at 08:39:52AM -0300, Clodoaldo Pinto wrote:
>
> begin;
> select update_last_date();
> truncate times_producao;

TRUNCATE acquires an AccessExclusiveLock, which conflicts with all
other lock types.  Locks are held until the transaction completes,
so once this lock is acquired no other transactions will be able
to access the table until this transaction commits or rolls back.

DELETE is slower than TRUNCATE but it won't block readers in other
transactions.

--
Michael Fuhr

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

Предыдущее
От: tomtailor@freesurf.fr
Дата:
Сообщение: Re: Resore PG-Data from Files after crash
Следующее
От: "Reid Thompson"
Дата:
Сообщение: Re: Select gives the wrong results