Re: Add SPLIT PARTITION/MERGE PARTITIONS commands - Mailing list pgsql-hackers

From jian he
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CACJufxHHnJm6Jb2YQpuRU1RX__tO=JJNJ5=EUMuzif_KNxGd9A@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (jian he <jian.universality@gmail.com>)
Responses Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
List 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".



pgsql-hackers by date:

Previous
From: Eduard Stefes
Date:
Subject: [V2] Adding new CRC32C implementation for IBM S390X
Next
From: Peter Eisentraut
Date:
Subject: Re: Missing program_XXX calling in pgbench tests