Re: The documentation for READ COMMITTED may be incomplete or wrong
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>,
Amit Langote <amitlangote09@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-05-18T23:57:14Z
Lists: pgsql-hackers
Attachments
- v2-fix-EPQ-HEAD-only.patch (text/x-diff) patch v2
I wrote: > Debian Code Search doesn't know of any outside code touching > relsubs_done, so I think we are safe in dropping that code in > ExecScanReScan. It seems quite pointless anyway considering > that up to now, EvalPlanQualBegin has always zeroed the whole > array. Oh, belay that. What I'd forgotten is that it's possible that the target relation is on the inside of a nestloop, meaning that we might need to fetch the EPQ substitute tuple more than once. So there are three possible states: blocked (never return a tuple), ready to return a tuple, and done returning a tuple for this scan. ExecScanReScan needs to reset "done" to "ready", but not touch the "blocked" state. The attached v2 mechanizes that using two bool arrays. What I'm thinking about doing to back-patch this is to replace one of the pointer fields in EPQState with a pointer to a subsidiary palloc'd structure, where we can put the new fields along with the cannibalized old one. We've done something similar before, and it seems a lot safer than having basically different logic in v16 than earlier branches. regards, tom lane
Commits
-
Fix misbehavior of EvalPlanQual checks with multiple result relations.
- 70b42f279029 16.0 landed
- ff77d8687fa3 12.16 landed
- f8320cc72ddb 14.9 landed
- 956c6256a98e 13.12 landed
- 4729d1e8aab9 15.4 landed
-
Rework planning and execution of UPDATE and DELETE.
- 86dc90056dfd 14.0 cited