From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Kris Kiger <kris@musicrebellion.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Concurrency
Date: Mon, 09 May 2005 15:18:40 -0400
Message-ID: <515.1115666320@sss.pgh.pa.us> (raw)
In-Reply-To: <1115665123.3830.38.camel@localhost.localdomain>
References: <671060015.20031010095617@roaddep.ru>
<427F9C06.3070206@musicrebellion.com>
<1115665123.3830.38.camel@localhost.localdomain>
Simon Riggs <simon@2ndquadrant.com> writes:
> On Mon, 2005-05-09 at 12:21 -0500, Kris Kiger wrote:
>> Quick question. I lock a table, call it table X, and then issue two
>> updates on that table. The two updates are left waiting. I then unlock
>> the table. The two updates go through. My question is, is there a
>> predictable way to determine which query will be executed first?
> The lock queue is served in FIFO sequence.
... usually. We will promote later arrivals in front of older ones if
the alternative would be a deadlock (eg, the later one already holds
some lock that would block the earlier one).
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com, kris@musicrebellion.com
Subject: Re: Concurrency
In-Reply-To: <515.1115666320@sss.pgh.pa.us>
References: <671060015.20031010095617@roaddep.ru> <427F9C06.3070206@musicrebellion.com> <1115665123.3830.38.camel@localhost.localdomain> <515.1115666320@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox