X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 61DC952A3D for ; Mon, 9 May 2005 18:42:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97377-02 for ; Mon, 9 May 2005 21:42:26 +0000 (GMT) Received: from cmailg1.svr.pol.co.uk (cmailg1.svr.pol.co.uk [195.92.195.171]) by svr1.postgresql.org (Postfix) with ESMTP id F195E52A38 for ; Mon, 9 May 2005 18:42:25 -0300 (ADT) Received: from modem-2119.lemur.dialup.pol.co.uk ([217.135.136.71] helo=192.168.0.102) by cmailg1.svr.pol.co.uk with esmtp (Exim 4.41) id 1DVG15-0001f1-Je; Mon, 09 May 2005 22:42:19 +0100 Subject: Re: Concurrency From: Simon Riggs To: Tom Lane Cc: Kris Kiger , pgsql-admin@postgresql.org 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> Content-Type: text/plain Organization: 2nd Quadrant Date: Mon, 09 May 2005 22:38:35 +0100 Message-Id: <1115674715.3830.78.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/101 X-Sequence-Number: 17530 On Mon, 2005-05-09 at 15:18 -0400, Tom Lane wrote: > Simon Riggs 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). Thats part of deadlock detection? I had thought we just blew one away... Thanks, Best Regards, Simon Riggs