agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: daku.sandor@gmail.com
To: Tom Paynter <tompaynter@tdpe.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: Advisory locks
Date: Wed, 11 Feb 2015 11:40:38 +0100
Message-ID: <20150211104038.5402756.43145.2247@gmail.com> (raw)
In-Reply-To: <da68e78ba167e84fc7e58c74ac5ae64d.squirrel@webmail.tdpe.co.uk>
References: <da68e78ba167e84fc7e58c74ac5ae64d.squirrel@webmail.tdpe.co.uk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (3+ messages) latest in thread
Message-ID: <20150211104038.5402756.43145.2247@gmail.com>
Permalink: ../20150211104038.5402756.43145.2247@gmail.com/
Also on: postgresql.org/message-id/20150211104038.5402756.43145.2247@gmail.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: daku.sandor@gmail.com, tompaynter@tdpe.co.uk
Subject: Re: Advisory locks
In-Reply-To: <20150211104038.5402756.43145.2247@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox