Hi Qifan,
I am leaning toward not a bug because all the rows of
pg_partition_tree() are already built before drop_p1() runs. So the
query drops the table under its own result. It is not specific to
this function. Selecting inhrelid::regclass from pg_inherits with
drop_p1() next to it shows a numeric OID too.
Thanks,
Shihao