Thanks for the patch. One more case needs the same guard. A policy on
another table can depend on the column through a subquery, and DROP
POLICY only locks that other table.
CREATE POLICY pol ON u USING (a IN (SELECT v FROM t));
With v2 and your injection point, dropping pol while the ALTER waits
still gives "could not find tuple for policy". Doing the same
missing_ok check in the PolicyRelationId branch fixes it.
Thanks,
Shihao