Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2024-04-28 00:59:37
Message-ID: CAPpHfduYuYECrqpHMgcOsNr+4j3uJK+JPUJ_zDBn-tqjjh3p1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Pavel.

Thank you for the review.

On Fri, Apr 26, 2024 at 4:33 PM Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> wrote:
> I've looked at the patchset:
>
> 0001 Look good.
> 0002 Also right with docs modification proposed by Justin.

Modified as proposed by Justin. The documentation for the way new
partitions are created is now in separate patch.

> 0003:
> Looks like unused code
> 5268 datum = cmpval ? list_nth(spec->lowerdatums, abs(cmpval) - 1) : NULL;
> overridden by
> 5278 datum = list_nth(spec->upperdatums, abs(cmpval) - 1);
> and
> 5290 datum = list_nth(spec->upperdatums, abs(cmpval) - 1);
>
> Otherwise - good.

Fixed, thanks.

> 0004:
> I suggest also getting rid of thee-noun compound words like: salesperson_name. Maybe salesperson -> clerk? Or maybe use the same terms like in pgbench: branches, tellers, accounts, balance.

Thank you, but I'd like to prefer keeping these modifications simple.
It's just regression tests, we don't need to have perfect naming here.
My intention is to fix just obvious errors.

> 0005: Good
> 0006: Patch is right
> In comments:
> + New partitions will have the same table access method,
> + same column names and types as the partitioned table to which they belong.
> (I'd suggest to remove second "same")

Documentation is modified per proposal by Justin. Thus double "same"
is already gone.

> Tests are passed. I suppose that it's better to add similar tests for SPLIT/MERGE PARTITION(S) to those covering ATTACH/DETACH PARTITION (e.g.: subscription/t/013_partition.pl and regression tests)

The revised patchset is attached. I'm going to push it if there are
no objections.

Thank you for your suggestions about adding tests similar to
subscription/t/013_partition.pl. I will work on this after pushing
this patchset.

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v9-0001-Change-the-way-ATExecMergePartitions-handles-the-.patch application/octet-stream 7.5 KB
v9-0003-Make-new-partitions-with-parent-s-persistence-dur.patch application/octet-stream 37.1 KB
v9-0004-Fix-error-message-in-check_partition_bounds_for_s.patch application/octet-stream 3.8 KB
v9-0002-Document-the-way-parition-MERGE-SPLIT-operations-.patch application/octet-stream 2.2 KB
v9-0005-Rename-tables-in-tests-of-partition-MERGE-SPLIT-o.patch application/octet-stream 205.0 KB
v9-0007-Inherit-parent-s-AM-for-partition-MERGE-SPLIT-ope.patch application/octet-stream 9.2 KB
v9-0006-Add-tab-completion-for-partition-MERGE-SPLIT-oper.patch application/octet-stream 2.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-04-28 01:04:54 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Previous Message Andy Fan 2024-04-28 00:02:13 Re: New committers: Melanie Plageman, Richard Guo