Re: FOR KEY LOCK foreign keys - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: FOR KEY LOCK foreign keys
Date
Msg-id 1311807810-sup-1055@alvh.no-ip.org
Whole thread Raw
In response to FOR KEY LOCK foreign keys  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: FOR KEY LOCK foreign keys
List pgsql-hackers
Hackers,

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

http://archives.postgresql.org/message-id/1294953201-sup-2099@alvh.no-ip.org

Mainly, this patch addresses the numerous comments by Noah Misch here:
http://archives.postgresql.org/message-id/20110211071322.GB26971@tornado.leadboat.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@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment

pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: patch for 9.2: enhanced errors
Next
From: Tom Lane
Date:
Subject: Re: Is a heads-up in 9.1 in order regarding the XML-related changes in 9.2?