Does creating partitions using pg_partman locks the table

110 Views Asked by At

We are exploring and comparing pg_partman and timescale for auto creation and maintenance of partitions. The post here says pg_partman locks the table and may block writes on table. https://www.timescale.com/learn/pg_partman-vs-hypertables-for-postgres-partitioning

Is this still true? And for how long does pg_partman locks the table while creating new partitions?

1

There are 1 best solutions below

0
On

Not a partman user here but, the text says:

If your workload involves sporadic or irregular data ingestions, you’ll need to ensure you aren't creating excessive, unnecessary partitions, as they could degrade query performance and lead to table bloat.

The lock is while creating the partition. If you have the data and partition is not ready or creating it, it will give you an error which may block your writes.

For large databases it can be slow: https://github.com/pgpartman/pg_partman/issues/107