Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2025-06-05 16:40:12
Message-ID: d1e414d0-a072-4be6-8aaf-f0b0770362cd@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Alexander!
Thanks for your notes!

1.
>Why don't you use *existing_relation_id argument of
>RangeVarGetAndCheckCreationNamespace(), when it is called from
>createPartitionTable() and ATExecSplitPartition()? This argument
>provide an elegant way to find a duplicate table with the same name.

Code changed.

2.
>It also seems that 0002 patch has the following error message, which
>aren't experienced in the regression tests.

2a. Added tests for these error messages:
+errmsg("upper bound of partition \"%s\" is not equal to upper bound of
split partition",
+errmsg("new partition \"%s\" cannot have this value because split
partition does not have",
+errmsg("DEFAULT partition should be one"),
+errmsg("new partition cannot be DEFAULT because DEFAULT partition
already exists"),

2b. Tests for these error messages already exists:
+errmsg("new partitions do not have value %s but split partition does",
+errmsg("one partition in the list should be DEFAULT because split
partition is DEFAULT"),

2c. The error message
+errmsg("can not find partition for split partition row"),
cannot be reproduced using regression tests, because it is issued when
partition contains a record that should not be there (i.e. when the
database is corrupted).

--
With best regards,
Dmitry Koval

Postgres Professional: http://postgrespro.com

Attachment Content-Type Size
v41-0001-Implement-ALTER-TABLE-.-MERGE-PARTITIONS-.-comma.patch text/plain 146.0 KB
v41-0002-Implement-ALTER-TABLE-.-SPLIT-PARTITION-.-comman.patch text/plain 213.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Koval 2025-06-05 16:41:22 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Previous Message Noah Misch 2025-06-05 16:34:41 Re: Wrong security context for deferred triggers?