Remove unused function parameter in get_qual_from_partbound
authorJohn Naylor <john.naylor@postgresql.org>
Wed, 14 Jul 2021 13:52:04 +0000 (09:52 -0400)
committerJohn Naylor <john.naylor@postgresql.org>
Wed, 14 Jul 2021 13:52:04 +0000 (09:52 -0400)
Commit 0563a3a8b changed how partition constraints were generated such
that this function no longer computes the mapping of parent attnos to
child attnos.

This is an external function that extensions could use, so this is
potentially a breaking change. No external callers are known, however,
and this will make it simpler to write such callers in the future.

Author: Hou Zhijie
Reviewed-by: David Rowley, Michael Paquier, Soumyadeep Chakraborty
Discussion: https://www.postgresql.org/message-id/flat/OS0PR01MB5716A75A45BE46101A1B489894379@OS0PR01MB5716.jpnprd01.prod.outlook.com

src/backend/commands/tablecmds.c
src/backend/partitioning/partbounds.c
src/backend/utils/cache/partcache.c
src/include/partitioning/partbounds.h

index dcf14b9dc0e549be13a116a368723033b9dbe662..96375814a8f3188e78d6a4bb4632a4d2091de5d6 100644 (file)
@@ -17350,7 +17350,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
     * If the parent itself is a partition, make sure to include its
     * constraint as well.
     */
-   partBoundConstraint = get_qual_from_partbound(attachrel, rel, cmd->bound);
+   partBoundConstraint = get_qual_from_partbound(rel, cmd->bound);
    partConstraint = list_concat(partBoundConstraint,
                                 RelationGetPartitionQual(rel));
 
index 38baaefcda3a914a53a4605c1d426055ae628fbc..1ec141b9eb0accac0e1df3bcad3edf884a308762 100644 (file)
@@ -246,8 +246,7 @@ static List *get_range_nulltest(PartitionKey key);
  *     expressions as partition constraint
  */
 List *
-get_qual_from_partbound(Relation rel, Relation parent,
-                       PartitionBoundSpec *spec)
+get_qual_from_partbound(Relation parent, PartitionBoundSpec *spec)
 {
    PartitionKey key = RelationGetPartitionKey(parent);
    List       *my_qual = NIL;
index 21e60f0c5e817836c61c5025c129149986e06596..f2b48678864b500033cccacf1dcd8e7c1e713489 100644 (file)
@@ -376,7 +376,7 @@ generate_partition_qual(Relation rel)
        bound = castNode(PartitionBoundSpec,
                         stringToNode(TextDatumGetCString(boundDatum)));
 
-       my_qual = get_qual_from_partbound(rel, parent, bound);
+       my_qual = get_qual_from_partbound(parent, bound);
    }
 
    ReleaseSysCache(tuple);
index ebf3ff1f4973c95907edb66879c47f5c71f8f797..2f00f9aa3d7858c61e97c51ed29319828cf505a1 100644 (file)
@@ -85,7 +85,7 @@ extern int    get_hash_partition_greatest_modulus(PartitionBoundInfo b);
 extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
                                           Oid *partcollation,
                                           Datum *values, bool *isnull);
-extern List *get_qual_from_partbound(Relation rel, Relation parent,
+extern List *get_qual_from_partbound(Relation parent,
                                     PartitionBoundSpec *spec);
 extern PartitionBoundInfo partition_bounds_create(PartitionBoundSpec **boundspecs,
                                                  int nparts, PartitionKey key, int **mapping);