Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2025-06-05 07:16:34
Message-ID: CACJufxHHnJm6Jb2YQpuRU1RX__tO=JJNJ5=EUMuzif_KNxGd9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.
bug in transformPartitionCmdForMerge "equal(name, name2))"

+static void
+transformPartitionCmdForMerge(CreateStmtContext *cxt, PartitionCmd *partcmd)
+{
+
+
+ foreach(listptr, partcmd->partlist)
+ {
+ RangeVar *name = (RangeVar *) lfirst(listptr);
+
+ /* Partitions in the list should have different names. */
+ for_each_cell(listptr2, partcmd->partlist, lnext(partcmd->partlist, listptr))
+ {
+ RangeVar *name2 = (RangeVar *) lfirst(listptr2);
+
+ if (equal(name, name2))
+ ereport(ERROR,
+ errcode(ERRCODE_DUPLICATE_TABLE),
+ errmsg("partition with name \"%s\" is already used", name->relname),
+ parser_errposition(cxt->pstate, name2->location));
+ }

ALTER TABLE sales_range MERGE PARTITIONS (sales_feb2022,
public.sales_feb2022) INTO sales_feb_mar2022;
ERROR: lower bound of partition "sales_feb2022" conflicts with upper
bound of previous partition "sales_feb2022"
in this context. "sales_feb2022" is the same as "public.sales_feb2022".

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-06-05 07:19:48 Re: Missing program_XXX calling in pgbench tests
Previous Message Eduard Stefes 2025-06-05 07:15:10 [V2] Adding new CRC32C implementation for IBM S390X