summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Naylor2021-07-14 13:52:04 +0000
committerJohn Naylor2021-07-14 13:52:04 +0000
commitc203dcddf997180000bc574a60313f3437e35af9 (patch)
tree042fb8c87cd37ef63f7192119b3cc02e465927be
parenteec57115e4c866f26bdc8bcbe3e2e7be4c6d0450 (diff)
Remove unused function parameter in get_qual_from_partbound
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
-rw-r--r--src/backend/commands/tablecmds.c2
-rw-r--r--src/backend/partitioning/partbounds.c3
-rw-r--r--src/backend/utils/cache/partcache.c2
-rw-r--r--src/include/partitioning/partbounds.h2
4 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index dcf14b9dc0..96375814a8 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -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));
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 38baaefcda..1ec141b9eb 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -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;
diff --git a/src/backend/utils/cache/partcache.c b/src/backend/utils/cache/partcache.c
index 21e60f0c5e..f2b4867886 100644
--- a/src/backend/utils/cache/partcache.c
+++ b/src/backend/utils/cache/partcache.c
@@ -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);
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index ebf3ff1f49..2f00f9aa3d 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -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);