Avoid redundant relation lock grabs during planning, and make sure
Tom Lane <tgl@sss.pgh.pa.us>
Avoid redundant relation lock grabs during planning, and make sure that we acquire a lock on relations added to the query due to inheritance. Formerly, no such lock was held throughout planning, which meant that a schema change could occur to invalidate the plan before it's even been completed.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/prep/preptlist.c | modified | +6 −4 |
| src/backend/optimizer/util/plancat.c | modified | +25 −6 |
| src/backend/optimizer/util/relnode.c | modified | +9 −11 |