pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@mail.com>
To: Andres Freund <andres@2ndquadrant.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org,"Alvaro Herrera" <alvherre@2ndquadrant.com>
Subject: Re: foreign key locks
Date: Mon, 29 Oct 2012 08:18:33 -0400
Message-ID: <20121029121833.306930@gmx.com> (raw)

Andres Freund wrote:
> On Sunday, October 28, 2012 11:47:16 PM Simon Riggs wrote:
>> Andres Freund <andres@2ndquadrant.com> wrote:

>>> * Is it ok to make FOR UPDATE somewhat weaker than before? In 9.2
>>> and earlier you could be sure that if you FOR UPDATE'ed a row you
>>> could delete it. Unless I miss something now this will not block
>>> somebody else acquiring a FOR KEY SHARE lock, so this guarantee
>>> is gone.
>> 
>> Yes, that is exactly the point of this.
> 
> The point is the introduction of a weaker lock level which can be 
> used by the ri triggers. I don't see any imperative that the
> semantics of the old lock level need to be redefined. That just
> seems dangerous to me.

I agree with Andres here -- the new lock level is needed within RI
triggers, and we might as well expose it for application programmer
use (with proper documentations), but there's no reason to break
existing application code by making the semantics of SELECT FOR
UPDATE less strict than they were before. Let's keep that term
meaning exactly the same thing if we can, and use new names for the
new levels.

We already present a barrier to people migrating from Oracle because
SELECT FOR UPDATE in PostgreSQL is weaker than it is in Oracle (where
it is just as strong as if an actual UPDATE were done -- write
conflicts and all); let's not increase the barrier by making SELECT
FOR UPDATE even weaker.

-Kevin




view thread (74+ messages)  latest in thread

Message-ID: <20121029121833.306930@gmx.com>
Permalink:  ../20121029121833.306930@gmx.com/
Also on:    postgresql.org/message-id/20121029121833.306930@gmx.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-hackers@postgresql.org
  Cc: kgrittn@mail.com, andres@2ndquadrant.com, simon@2ndquadrant.com, alvherre@2ndquadrant.com
  Subject: Re: foreign key locks
  In-Reply-To: <20121029121833.306930@gmx.com>

* 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