Re: pg_advisory_lock(bigint) vs. LOCK TABLE

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pg_advisory_lock(bigint) vs. LOCK TABLE
Дата
Msg-id 20080718183015.GH4042@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: pg_advisory_lock(bigint) vs. LOCK TABLE  (Mark Roberts <mailing_lists@pandapocket.com>)
Список pgsql-sql
Mark Roberts wrote:
> 
> On Thu, 2008-07-17 at 12:16 -0400, Alvaro Herrera wrote:
> > Volkan YAZICI wrote:
> > > Hi,
> > > 
> > > What's the difference between below two queue implementations?
> > 
> > They are two different lock spaces.  pg_advisory_lock does not conflict
> > with regular system locks, whereas LOCK TABLE does.
> 
> It also appears that advisory locks are tied to your session, where
> system locks are tied to your transaction.

Now that you mention that, I recall that the other important difference
is that you can release pg_advisory_lock anytime you want.  With LOCK
TABLE it always happens automatically at transaction commit (and there's
no UNLOCK TABLE).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Mark Roberts
Дата:
Сообщение: Re: pg_advisory_lock(bigint) vs. LOCK TABLE
Следующее
От: Karl Denninger
Дата:
Сообщение: Whassup with this? (create table .... like ... fails)