hi.
+ /*
+ * For simplify check for ranges of new partitions need to sort all
+ * partitions in ascending order of them bounds (we compare upper
+ * bound only).
+ */
+ lower_bounds = (PartitionRangeBound **)
+ palloc0(nparts * sizeof(PartitionRangeBound *));
+
+ /* Create array of lower bounds. */
+ for (i = 0; i < nparts; i++)
+ {
+ lower_bounds[i] = make_one_partition_rbound(key, i,
+ new_parts[i]->bound->lowerdatums, true);
+ }
+
I am confused by the above comments "we compare upper bound only".some of the function partition_rbound_cmp can be replaced by marco compare_range_bounds, for example in check_two_partitions_bounds_range we can use compare_range_bounds instead of partition_rbound_cmp not sure if it's worth it or not. doc: <varlistentry id="sql-altertable-split-partition"> should come after <varlistentry id="sql-altertable-merge-partitions"> I’ve refactored the SPLIT PARTITION docs quite a bit—let me know if they make sense. Also tweaked the regression tests a little again.
v61-0001-refactoring-based-on-v61.no-cfbot
Description: Binary data
