Re: BUG #17151: A SEGV in optimizer
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: 253540651@qq.com,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-08-18T23:24:20Z
Lists: pgsql-bugs
Attachments
- dont-lock-OLD-and-NEW-2.patch (text/x-diff) patch
I wrote: > (This passes check-world, but I've not double-checked to make sure > that inFromCl will be set in exactly the cases we want.) After studying the code a bit more, I remembered why my hindbrain was feeling uncomfortable about that coding: parsenodes.h says that inFromCl is quasi-deprecated and not used anymore during parsing. However, we can't really use the ParseNamespaceItem data structure for this purpose, because baserels should be available to lock whether or not they are visible according to join aliasing rules. I don't see a lot of point to inventing some complicated add-on for this when inFromCl will serve fine. So I think we should just adjust the relevant comments, say like the attached. We probably need some regression test cases added (I wonder whether FOR UPDATE in rule actions is covered at all ATM). Otherwise I feel like this is OK to commit. regards, tom lane
Commits
-
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.
- cc7fae5c2d9e 9.6.24 landed
- 2739a281060f 10.19 landed
- fbc1eed8a8dd 11.14 landed
- 8d2d6ec7708b 15.0 landed
- 7fa367d96bb1 13.5 landed
- 464900393352 14.0 landed
- 0c13ee198f0d 12.9 landed