Hi,

Julien Rouhaund, who has proposed a patch for partition-wise ordering
mentioned to me offlist that the comments for PartitionBoundInfoData
do not mention the fact that the datums in datums array are ordered. I
think that's important to mention there. So here's patch to do that.

The comment I have added refers to the functions which order the
datums, since every partition kind has different method of ordering
datums and I think the prologue is not a suitable place to explain
that ordering. I have added a sentence for range and list partitioning
since the ordering is easier to explain in those cases. Also added a
sentence about canonical PartitionBoundInfoData without using that
word.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c
index dd4a8d3..865f572 100644
--- a/src/backend/catalog/partition.c
+++ b/src/backend/catalog/partition.c
@@ -72,6 +72,13 @@
  * of datum-tuples with 2 datums, modulus and remainder, corresponding to a
  * given partition.
  *
+ * The datums in datums array are arranged in the increasing order defined by
+ * functions qsort_partition_rbound_cmp(), qsort_partition_list_value_cmp() and
+ * qsort_partition_hbound_cmp() for range, list and hash partitioned tables
+ * resp. For range and list partitions this simply means that the datums in the
+ * datums array are arranged in the increasing order defined by the partition
+ * key collation.
+ *
  * In the case of list partitioning, the indexes array stores one entry for
  * every datum, which is the index of the partition that accepts a given datum.
  * In case of range partitioning, it stores one entry per distinct range
@@ -82,6 +89,9 @@
  * partition which would accept that datum-tuple would be given by the entry
  * pointed by remainder produced when hash value of the datum-tuple is divided
  * by the greatest modulus.
+ *
+ * PartitionBoundInfoData structures for two partitioned table with exactly same
+ * bounds look exactly same.
  */
 
 typedef struct PartitionBoundInfoData

Reply via email to