Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Cc: stephane tachoires <stephane(dot)tachoires(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2024-03-26 23:39:04
Message-ID: CAPpHfdsVQwnZPxaQPwcu1g_01F0d-o=ECRcf14X3CmavJB6vSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 19, 2024 at 4:43 PM Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru> wrote:
> Thanks for info!
> I was unable to reproduce the problem and I wanted to ask for
> clarification. But your message was ahead of my question.

I've revised the patchset. I mostly did some refactoring, code
improvements and wrote new comments.

If I apply just the first two patches, I get the same error as [1].
This error happens when createPartitionTable() tries to copy the
identity of another partition. I've fixed that by skipping a copy of
the identity of another partition (remove CREATE_TABLE_LIKE_IDENTITY
from TableLikeClause.options). BTW, the same error happened to me
when I manually ran CREATE TABLE ... (LIKE ... INCLUDING IDENTITY) for
a partition of the table with identity. So, this probably deserves a
separate fix, but I think not directly related to this patch.

I have one question. 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?

Links.
1. https://www.postgresql.org/message-id/171085360143.2046436.7217841141682511557.pgcf%40coridan.postgresql.org

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
0003-Documentation-for-ALTER-TABLE-SPLIT-PARTITION-ME-v26.patch application/octet-stream 9.2 KB
0004-SPLIT-PARTITION-optimization-v26.patch application/octet-stream 41.3 KB
0002-ALTER-TABLE-SPLIT-PARTITION-command-v26.patch application/octet-stream 176.1 KB
0001-ALTER-TABLE-MERGE-PARTITIONS-command-v26.patch application/octet-stream 105.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-03-26 23:49:17 Re: [HACKERS] make async slave to wait for lsn to be replayed
Previous Message Tom Lane 2024-03-26 23:28:24 Re: add AVX2 support to simd.h