What about sth like that:

Normally the set of partitions established when initially defining the
> table is not intended to remain static. It is common to want to remove
> partitions holding old data and periodically add new partitions for new
> data. One of the most important advantages of partitioning is precisely
> that it allows this otherwise painful task to be executed nearly
> instantaneously by manipulating the partition structure, rather than
> physically moving large amounts of data around.

There are two ways for removing old data:

1) Drop the partition that is no longer necessary
>
DROP TABLE measurement_y2006m02;
>
This is he simplest option for removing old data. This can very quickly
> delete millions of records because it doesn't have to individually delete
> every record. Note however that the above command requires taking an ACCESS
> EXCLUSIVE lock on the parent table.
>
2) Disconnect the partition from the partitioned table
>
This option that is often preferable. We are retaining access to data as a
> table in its own right. This has two forms:



czw., 15 maj 2025 o 20:28 Tom Lane <t...@sss.pgh.pa.us> napisał(a):

> =?utf-8?Q?=C3=81lvaro?= Herrera <alvhe...@kurilemu.de> writes:
> > On 2025-May-13, Tom Lane wrote:
> >>> "Another option that is often preferable is to remove the partition
> >>> from the partitioned table but retain access to it as a table in its
> own
> >>> right."
>
> >> AFAICS, it's correct as written.
>
> > Yeah, but maybe it would be clearer if the word "remove" were "detach".
> > I don't find the phrase "remove the partition from the partitioned
> > table" particulary suggestive of what's being described.
>
> Hm, maybe, but would that be putting too much emphasis on "detach" because
> it's the command keyword?
>
>                         regards, tom lane
>


-- 
Pozdrawiam
Paweł Szymczyk

Reply via email to