Inheritance
ALTER TABLE ... NO INHERIT
ALTER TABLE orders_archive NO INHERIT orders; What this does
Brief but ACCESS EXCLUSIVE on both parent and child. Verify no application code or query planner assumption depends on the inheritance relationship before removing it.
Safe rewrite
Schedule in a maintenance window with an explicit lock_timeout
SET lock_timeout = '2s';
ALTER TABLE orders_archive NO INHERIT orders;