public inbox for [email protected]  
help / color / mirror / Atom feed
From: ravi k <[email protected]>
To: Keith Fiske <[email protected]>
Cc: Loles <[email protected]>
Cc: pgsql-admin <[email protected]>
Subject: Re: Partitioning without downtime
Date: Fri, 22 Apr 2022 22:12:49 +0530
Message-ID: <CAFL4M8H1kmnx=NMmOk=rdV_31cE27JeSadwjm097NQKadyy9yw@mail.gmail.com> (raw)
In-Reply-To: <CAODZiv6XDLy3n=WPU3a=Ra27M=sgiwQP=FX=2mW7FzJnVChLBw@mail.gmail.com>
References: <CA+FWGK6pT2TKQ0iNH0=6SYOpi560KdLy4kWzKps_B8GMsM4QwA@mail.gmail.com>
	<CAODZiv6XDLy3n=WPU3a=Ra27M=sgiwQP=FX=2mW7FzJnVChLBw@mail.gmail.com>

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, <[email protected]>
wrote:

>
>
> On Fri, Apr 22, 2022 at 11:28 AM Loles <[email protected]> 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
>


view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Partitioning without downtime
  In-Reply-To: <CAFL4M8H1kmnx=NMmOk=rdV_31cE27JeSadwjm097NQKadyy9yw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox