Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTfPx-0007NV-3v for pgsql-hackers@postgresql.org; Wed, 31 Oct 2012 21:01:41 +0000 Received: from mail-vc0-f174.google.com ([209.85.220.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTfPq-00032W-Df for pgsql-hackers@postgresql.org; Wed, 31 Oct 2012 21:01:40 +0000 Received: by mail-vc0-f174.google.com with SMTP id fk26so2000280vcb.19 for ; Wed, 31 Oct 2012 14:01:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=x4P774bdeF0wgL0GbTm99VFOAs/xTLj1X20A11V7Fhs=; b=VsT/NxUZftY5JuhJT1pefZomcmU/dqx6Qi3RRwPnb3kXwjAWkwfrc2n9ef74NDgjEq WwIoLRrm4lpvulkf2u59psUf093tlnQBTAIeV8ZWcYl70sCL6d/xzwgq+00jvfdnn1z/ CYkeWkDZWXzECv9s/m4stGtgXlJDueDkRZ1l5z5QMXJxQN52sLOE1VcACWktycszmiZQ Z/YEPs9FSq9IBi4f5z+KIT4+W9TQ0gfJci/vOG/kgBdvE3fyeHggydn6xNWJ2ZJXIIB+ vdE4v1SGQFD/Fm+qsFdxWdGZtDPEHATChMk2dxaP5/tMEU1SuTExJeFD2uEDHiUuQbi+ onwg== Received: by 10.220.149.142 with SMTP id t14mr20114219vcv.46.1351717292617; Wed, 31 Oct 2012 14:01:32 -0700 (PDT) Received: from tornado.leadboat.com (ip68-105-236-221.hr.hr.cox.net. [68.105.236.221]) by mx.google.com with ESMTPS id i15sm2745385vdt.0.2012.10.31.14.01.30 (version=SSLv3 cipher=OTHER); Wed, 31 Oct 2012 14:01:31 -0700 (PDT) Date: Wed, 31 Oct 2012 17:01:29 -0400 From: Noah Misch To: Alvaro Herrera Cc: Simon Riggs , Kevin Grittner , Andres Freund , pgsql-hackers@postgresql.org Subject: Re: foreign key locks Message-ID: <20121031210129.GD29247@tornado.leadboat.com> References: <20121029121833.306930@gmx.com> <20121031193536.GA1651@tornado.leadboat.com> <20121031202209.GF23139@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121031202209.GF23139@alvh.no-ip.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Gm-Message-State: ALoCoQm0SSGUBDp329g3gTx9ReIYf+x2I45K73qtMxjgareoZBSPAcTiksi8++EZrgOL6PMTGprG X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201210/1614 X-Sequence-Number: 215850 On Wed, Oct 31, 2012 at 05:22:10PM -0300, Alvaro Herrera wrote: > Simon Riggs wrote: > > On 31 October 2012 19:35, Noah Misch wrote: > > > +1. I had not considered this angle during previous reviews, but I agree with > > > Andres's position. Since this patch does not strengthen the strongest tuple > > > lock relative to its PostgreSQL 9.2 counterpart, that lock type should > > > continue to use the syntax "FOR UPDATE". It will come to mean "the lock type > > > sufficient for all possible UPDATEs of the row". > > Yeah, I agree with this too. > > > So we have syntax > > > > FOR NON KEY UPDATE > > FOR KEY UPDATE > > > > KEY is the default, so FOR UPDATE is a synonym of FOR KEY UPDATE > > Not really sure about the proposed syntax, but yes clearly we need some > other syntax to mean "FOR NON KEY UPDATE". I would rather keep FOR > UPDATE to mean what I currently call FOR KEY UPDATE. More proposals for > the other (weaker) lock level welcome (but if you love FOR NON KEY > UPDATE, please chime in too) Agree on having "FOR UPDATE" without any "FOR KEY UPDATE" synonym. For the weaker lock, I mildly preferred the proposal of "FOR NO KEY UPDATE". NON KEY captures the idea better in English, but NO is close enough and already part of the SQL lexicon.