Partitions

ALTER TABLE ... DETACH PARTITION CONCURRENTLY

PostgreSQL 14+

Lock mode SHARE UPDATE EXCLUSIVE
Risk LOW
Blocks other DDL
ALTER TABLE orders DETACH PARTITION orders_2025_01 CONCURRENTLY;

What this does

Non-blocking: SHARE UPDATE EXCLUSIVE allows ordinary reads and writes to continue on both the parent and the partition during the detach.

Read more

More in Partitions