Subject: Partitioning without downtime

From: Loles <[email-masked]>
Date: Fri, 22 Apr 2022 17:27:44 +0200

Hi!

Is there a way to partition a table in production without downtime? Or
extension that allows it.

Thanks!

---

From: Keith Fiske <[email-masked]>
Date: Fri, 22 Apr 2022 11:38:08 -0400

> extension that allows it.

Zero downtime (or without a table lock at some point) is not possible with
native partitioning since you cannot convert an existing table into a
natively partitioned table. However, it is possible to do it with very
little downtime if the circumstances allow. I've laid out a method of doing
this with pg_partman here -
https://github.com/pgpartman/pg_partman/blob/master/doc/pg_partman_howto_native.md

-- 
Keith Fiske
Senior Database Engineer
Crunchy Data - http://crunchydata.com

---

From: ravi k <[email-masked]>
Date: Fri, 22 Apr 2022 22:12:49 +0530

If you want update historical data while cutover it's difficult else you
can load historical data as chunks and then during switchover apply access
exclusive lock on table and load latest few hours data and rename table in
single  transaction.

Best,
Ravindra