Reduce locks when detaching database partitions
Postgres 14 adds support for detaching partitions with a reduced lock level, using ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY (and also FINALIZE if there are errors during the detaching process).
This increases the complexity of our detaching logic for partitions (detaching can take a much longer amount of time, only one partition can be detached at a time, and the worker will need to recover and FINALIZE if the operation is aborted). However, the reduced locking will help improve database stability.
-
change the partition manager to drop partitions concurrently
Edited by Simon Tomlinson