Re: Add SPLIT PARTITION/MERGE PARTITIONS commands - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CAPpHfdsCCV8DOv0Ovu4dTSnuWXiEz_AjuW-J6TPj++tcfEGvRw@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
List pgsql-hackers
Hi, Dmitry!

Thank you for your feedback!

On Wed, Mar 27, 2024 at 10:18 PM Dmitry Koval <d.koval@postgrespro.ru> wrote:
>  > I've fixed that by skipping a copy of the identity of another
>  > partition (remove CREATE_TABLE_LIKE_IDENTITY from
>  > TableLikeClause.options).
>
> Thanks for correction!
> Probably I should have looked at the code more closely after commit [1].
> I'm also very glad that situation [2] was reproduced.
>
>  > When merging partitions you're creating a merged partition like the
>  > parent table.   But when splitting a partition you're creating new
>  > partitions like the partition being split.  What motivates this
>  > difference?
>
> When splitting a partition, I planned to set parameters for each of the
> new partitions (for example, tablespace parameter).
> It would make sense if we want to transfer part of the data of splitting
> partition to a slower (archive) storage device.
> Right now I haven't seen any interest in this functionality, so it
> hasn't been implemented yet. But I think this will be needed in the future.

OK, I've changed the code to use the parent table as a template for
new partitions in split case.  So, now it's the same in both split and
merge cases.

I also added a special note into docs about ACCESS EXCLUSIVE lock,
because I believe that's a significant limitation for usage of this
functionality.

I think 0001, 0002 and 0003 could be considered for pg17.  I will
continue reviewing them.

0004 might require more work.  I didn't rebase it for now.  I suggest
we can rebase it later and consider for pg18.

------
Regards,
Alexander Korotkov

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Combine Prune and Freeze records emitted by vacuum
Next
From: Alvaro Herrera
Date:
Subject: Re: pgbnech: allow to cancel queries during benchmark