From:
"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To:
"Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc:
"Simon Riggs" <simon(at)2ndquadrant(dot)com>,
"Noah Misch" <noah(at)leadboat(dot)com>,
"Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>,
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject:
Re: foreign key locks, 2nd attempt
Date:
2012-02-23 18:44:50
Message-ID:
4F4634C20200002500045ACE@gw.wicourts.gov (view raw or flat )
Thread:
2011-11-03 18:12:49 from Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
2011-11-06 07:28:52 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2011-11-10 20:17:59 from Christopher Browne <cbbrowne(at)gmail(dot)com>
2011-11-10 20:21:39 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-10 20:29:44 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2011-11-10 20:38:41 from Christopher Browne <cbbrowne(at)gmail(dot)com>
2011-11-11 17:30:18 from David Kerr <dmk(at)mr-paradox(dot)net>
2011-11-12 04:21:10 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2011-11-19 09:21:41 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2011-11-10 19:59:20 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-11-10 21:09:12 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-11-10 21:19:59 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-11-11 22:02:00 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-11-19 09:21:51 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2011-11-19 15:36:48 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-21 17:09:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-11-21 20:26:55 from Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
2011-12-04 12:20:27 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-12 20:20:39 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-12 21:03:37 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-13 14:44:49 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-13 16:09:46 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-13 16:20:10 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-13 21:36:21 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-14 15:21:29 from Noah Misch <noah(at)leadboat(dot)com>
2011-12-14 15:36:54 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-16 13:37:16 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-02-23 14:15:45 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 15:04:14 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 15:12:13 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 15:49:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 15:28:20 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-02-23 16:01:33 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 16:31:36 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-02-23 17:45:45 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 18:44:50 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-02-25 01:06:49 from Vik Reykja <vikreykja(at)gmail(dot)com>
2012-02-25 18:06:38 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-02-23 18:41:21 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-27 02:47:50 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-05 18:28:59 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-05 18:37:53 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-05 19:34:10 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-05 19:53:37 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-05 20:35:15 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-06 19:58:22 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-06 19:39:32 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 20:28:12 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-17 23:11:57 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 21:10:16 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-06 21:27:51 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 21:40:51 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-07 09:24:11 from Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
2012-03-07 10:02:43 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-07 10:18:26 from Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
2012-03-07 11:11:06 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-07 11:37:01 from Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
2012-03-07 12:16:22 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-06 21:33:13 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-17 23:01:51 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-13 17:00:52 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-13 17:35:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 03:04:06 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 03:08:29 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 13:36:11 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 13:40:01 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 18:15:11 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-17 22:58:41 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-12 17:28:11 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-12 17:50:11 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-12 18:14:33 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-12 19:28:21 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2012-03-13 17:46:24 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-14 03:42:26 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-14 17:23:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-14 22:10:00 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-15 01:17:33 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-15 02:26:53 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-15 21:38:53 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:54:32 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-15 22:04:41 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 22:13:45 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-15 22:23:32 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:46:44 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:55:05 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-17 22:45:20 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-25 08:17:59 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-04-05 18:50:58 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-03-15 02:15:22 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-15 21:20:38 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-15 21:07:28 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-03-16 00:37:36 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-16 00:53:05 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-16 01:52:12 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-16 03:09:52 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 14:08:07 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-16 18:22:05 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-16 18:49:03 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-13 01:24:40 from Noah Misch <noah(at)leadboat(dot)com>
2012-03-13 17:09:57 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-02-27 12:13:32 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2012-02-28 00:28:14 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-28 07:55:31 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-01-15 04:49:54 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-16 19:17:42 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2012-01-16 19:52:36 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-17 06:21:28 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2012-01-18 20:18:31 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-19 02:11:35 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-17 09:56:04 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-17 09:39:13 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-24 18:47:16 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-26 19:03:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-27 23:47:27 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-30 23:48:47 from Noah Misch <noah(at)leadboat(dot)com>
2012-01-31 13:17:40 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-31 14:19:57 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-31 16:18:30 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-31 16:58:21 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-31 17:12:10 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-31 23:55:19 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-13 22:16:58 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-22 17:00:07 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-23 09:18:57 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 13:08:28 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2012-02-23 14:21:39 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-02-23 21:12:35 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-24 09:38:52 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2012-02-23 15:43:11 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 17:48:13 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-02-23 18:04:26 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 18:30:09 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-02-24 04:53:34 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-23 21:36:42 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-23 23:57:47 from Noah Misch <noah(at)leadboat(dot)com>
2012-02-02 00:33:47 from Jim Nasby <jim(at)nasby(dot)net>
2012-02-02 00:58:42 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Lists:
pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> Excerpts from Kevin Grittner's message:
>> Since the limitation on what can be stored in xmax was the killer
>> for Florian's attempt to support SELECT FOR UPDATE in a form
>> which was arguably more useful (and certainly more convenient for
>> those converting from other database products), I'm wondering
>> whether anyone has determined whether this new scheme would allow
>> Florian's work to be successfully completed. The issues seem
>> very similar. If this approach also provides a basis for the
>> other work, I think it helps bolster the argument that this is a
>> good design; if not, I think it suggests that maybe it should be
>> made more general or extensible in some way. Once this has to be
>> supported by pg_upgrade it will be harder to change the format,
>> if that is needed for some other feature.
>
> I have no idea what improvements Florian was seeking, but
> multixacts now have plenty of bit flag space to indicate whatever
> we want for each member transaction, so most likely the answer is
> yes. However we need to make clear that a single SELECT FOR
> UPDATE in a tuple does not currently use a multixact; if we wish
> to always store flags then we are forced to use one which incurs a
> performance hit.
Well, his effort really started to go into a tailspin on the related
issues here:
http://archives.postgresql.org/pgsql-hackers/2010-12/msg01743.php
... with a summary of the problem and possible directions for a
solution here:
http://archives.postgresql.org/pgsql-hackers/2010-12/msg01833.php
One of the problems that Florian was trying to address is that
people often have a need to enforce something with a lot of
similarity to a foreign key, but with more subtle logic than
declarative foreign keys support. One example would be the case
Robert has used in some presentations, where the manager column in
each row in a project table must contain the id of a row in a person
table *which has the project_manager boolean column set to TRUE*.
Short of using the new serializable transaction isolation level in
all related transactions, hand-coding enforcement of this useful
invariant through trigger code (or application code enforced through
some framework) is very tricky. The change to SELECT FOR UPDATE
that Florian was working on would make it pretty straightforward.
-Kevin
In response to
Responses
pgsql-hackers by date
Next :From: David E. WheelerDate: 2012-02-23 18:54:00
Subject : Re: overriding current_timestamp
Previous :From : Simon RiggsDate : 2012-02-23 18:41:21
Subject : Re: foreign key locks, 2nd attempt