Skip site navigation (1) Skip section navigation (2)

Re: FOR KEY LOCK foreign keys

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FOR KEY LOCK foreign keys
Date: 2011-07-27 23:16:44
Message-ID: 1311807810-sup-1055@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Hackers,

This is an updated version of the patch I introduced here:

http://archives.postgresql.org/message-id/1294953201-sup-2099(at)alvh(dot)no-ip(dot)org

Mainly, this patch addresses the numerous comments by Noah Misch here:
http://archives.postgresql.org/message-id/20110211071322(dot)GB26971(at)tornado(dot)leadboat(dot)com
My thanks to Noah for the very exhaustive review and ideas.

I also removed the bit about copying the ComboCid to the new version of
the tuple during an update.  I think that must have been the result of
very fuzzy thinking; I cannot find any reasoning that leads to it being
necessary, or even correct.

I also included Marti Raudsepp's patch to consider only indexes usable
in foreign keys.

One thing I have not addressed is Noah's idea about creating a new lock
mode, KEY UPDATE, that would let us solve the initial problem that this
patch set to resolve in the first place.  I am not clear on exactly how
that is to be implemented, because currently heap_update and heap_delete
do not grab any kind of lock but instead do their own ad-hoc waiting.  I
think that might need to be reshuffled a bit, to which I haven't gotten
yet, and is a radical enough idea that I would like it to be discussed
by the hackers community at large before setting sail on developing it.
In the meantime, this patch does improve the current situation quite a
lot.

-- 
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment: fklocks-2.patch
Description: application/octet-stream (74.9 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2011-07-27 23:28:16
Subject: Re: Is a heads-up in 9.1 in order regarding the XML-related changes in 9.2?
Previous:From: Florian PflugDate: 2011-07-27 22:24:40
Subject: Re: patch for 9.2: enhanced errors

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group