Hi Tom, Thanks for committing 6b3f8857aa8. Both Asserts I mentioned still fire on master, so here is v2.
0001 is my old 0002. It clears tablesample of a rel removed by outer join removal. If you would rather forbid lateral refs in TABLESAMPLE, I am happy to write that. 0001 would still be needed for the back branches. 0002 clears securityQuals of a rel removed by self join elimination. The kept rel has the same quals because SJE requires the same checkAsUser and the same row mark type, so RLS still filters. 0003 adds both cases to join.sql. The tablesample Assert also fires on the REL_16_STABLE and REL_17_STABLE heads, since 2ebf25e7d70 went back to 16. Thanks, Shihao
v2-0001-Clear-tablesample-of-a-removed-rel-in-join-remova.patch
Description: Binary data
v2-0003-Add-tests-for-planner-restart-after-join-removal.patch
Description: Binary data
v2-0002-Clear-securityQuals-of-a-rel-removed-by-self-join.patch
Description: Binary data
