Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>,
Pavan Deolasee <pavan.deolasee@gmail.com>,
amul sul <sulamul@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>,
Stephen Frost <sfrost@snowman.net>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-03-08T19:25:59Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > On March 8, 2018 10:46:53 AM PST, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Breaking fundamental invariants like >> "ctid points to this tuple or its update successor" is going to cause >> trouble. There's a lot of code that knows that; more than knows the >> details of what's in xmax, I believe. > I don't think this is that big a problem. All code already needs to handle the case where ctid points to an aborted update tuple. Which might long have been replaced by as an independent role. That's why we have all this updated.xmax == new.xmin checks. Which will, without any changes, catch the proposed scheme, no? No. In those situations, the conclusion is that the current tuple is live, which is exactly the wrong conclusion for a cross-partition update. Or at least it might be the wrong conclusion ... I wonder how this patch works if the updating transaction aborted. regards, tom lane
Commits
-
Raise error when affecting tuple moved into different partition.
- f16241bef7cc 11.0 landed
-
Handle INSERT .. ON CONFLICT with partitioned tables
- 555ee77a9668 11.0 cited
-
Change the way we mark tuples as frozen.
- 37484ad2aace 9.4.0 cited