Re: Partitioning without downtime

Поиск
Список
Период
Сортировка
От ravi k
Тема Re: Partitioning without downtime
Дата
Msg-id CAFL4M8H1kmnx=NMmOk=rdV_31cE27JeSadwjm097NQKadyy9yw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Partitioning without downtime  (Keith Fiske <keith.fiske@crunchydata.com>)
Список pgsql-admin
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

On Fri, 22 Apr, 2022, 9:08 pm Keith Fiske, <keith.fiske@crunchydata.com> wrote:


On Fri, Apr 22, 2022 at 11:28 AM Loles <lolesft@gmail.com> wrote:
Hi!

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

Thanks!

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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Keith Fiske
Дата:
Сообщение: Re: Partitioning without downtime
Следующее
От: Sbob
Дата:
Сообщение: could not read block 0 in file Error