Re: Advisory locks

Поиск
Список
Период
Сортировка
От daku.sandor@gmail.com
Тема Re: Advisory locks
Дата
Msg-id 20150211104038.5402756.43145.2247@gmail.com
обсуждение исходный текст
Ответ на Advisory locks  ("Tom Paynter" <tompaynter@tdpe.co.uk>)
Список pgsql-sql
The parameter of the pg_advisory_lock is a simple bigint and of course it is completely unaware of the source of the
value.

Regards,
Sándor Daku

  Original Message  
From: Tom Paynter
Sent: 2015. február 11., szerda 11:33
To: pgsql-sql@postgresql.org
Subject: [SQL] Advisory locks

Hello All,

I have a quick question about advisory locks, that I have not been able to
figure out from the documentation.


Say I have two tables:
CREATE TABLE table_a
(
table_a_id serial primary key,
some more rows....
);

CREATE TABLE table_b
(
table_b_id serial primary key,
some more rows....
);


And I execute the following lines (from separate sessions):
SELECT pg_advisory_lock(table_a_id) FROM table_a WHERE table_a_id=5;
SELECT pg_advisory_lock(table_b_id) FROM table_b WHERE table_b_id=5;


Will this try to acquire the same lock?
Or is the id tied to the table somehow?


Thanks for your time.
Tom



--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



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

Предыдущее
От: "Tom Paynter"
Дата:
Сообщение: Re: Advisory locks
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Schema for caching message-count in folders using triggers