Re: Best Approach for Swapping a Table with its Copy - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: Best Approach for Swapping a Table with its Copy
Date
Msg-id CAKAnmmJ0=9m3gXvjvWVAbyJpU=Uopn1K5sQDOPWJG7GNRctPmg@mail.gmail.com
Whole thread Raw
In response to Re: Best Approach for Swapping a Table with its Copy  (Marcelo Fernandes <marcefern7@gmail.com>)
Responses Re: Best Approach for Swapping a Table with its Copy
List pgsql-general
On Thu, Feb 13, 2025 at 6:06 PM Marcelo Fernandes <marcefern7@gmail.com> wrote:
> It's technically possible to do something similar for your use case, but it's not trivial. All the cab to trailer wires must be precisely changed. Everything directly related to the data must be swapped: heap, indexes, toast.

I'd really appreciate to know more about how I can do this, as I think this is
the crux of what I am trying to solve.

The pg_repack link posted earlier has the details on how it is done. But messing with system catalogs like this is highly discouraged, for good reasons. Still, if you need to go that route, test heavily and post the solutions here for feedback.

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

pgsql-general by date:

Previous
From: Achilleas Mantzios - cloud
Date:
Subject: Re: Ideas about presenting data coming from sensors
Next
From: Greg Sabino Mullane
Date:
Subject: Re: Best Approach for Swapping a Table with its Copy