Hi Zsolt, Thanks for v2, it looks good to me.
I applied it on master and ran both test cases by hand, and also plain-leaf versions with VACUUM, REPACK and LOCK TABLE. Everything passes, and LOCK TABLE skips the dropped partition as expected. With the fix disabled, both of your test cases fail with "cache lookup failed" in has_subclass(). You're right about needing "a1". In my runs, with plain leaves the pg_publication_tables case didn't fail even without the fix (the dropped table was just left out), and the VACUUM case failed only when the backend hadn't already cached the dropped table. So your test is the more reliable one. One note for back-patching, the test uses string conditions for injection points, which only exist on master (0fd73cdffc1), so it can't go to the back branches. The fix itself should back-patch with small adjustments (an #include conflict on 18 and older, and 16 and older have no utils/injection_point.h). Otherwise I think this is ready for a committer to look at it. Regards, Surya Poondla
