Thread
-
Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Dmitry Koval <d.koval@postgrespro.ru> — 2025-06-05T16:40:12Z
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