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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Wed, 27 Jul 2011 19:16:44 -0400
  • Message-id: <1311807810-sup-1055@alvh.no-ip.org> <text/plain>

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: Binary data



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group