postgres.git / summary / log / commit / refs
commit 9a9ead1105482fc292eccf707697da2ebcc578e5
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Fri Mar 28 08:50:01 2025 +0000
First released in: 18.0
Rename a node field for clarity
Rename ResultRelInfo.ri_ConstraintExprs to ri_CheckConstraintExprs.
This reflects its specific purpose better and avoids confusion with
adjacent fields with similar but distinct purposes.
Discussion: https://postgr.es/m/CACJufxHArQysbDkWFmvK+D1TPHQWWTxWN15cMuUaTYX3xhQXgg@mail.gmail.com
src/backend/executor/execMain.c | 10 +++++-----
src/include/nodes/execnodes.h | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index e9bd98c7738..1cd4dbd2b90 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -1371,7 +1371,7 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
resultRelInfo->ri_projectNewInfoValid = false;
resultRelInfo->ri_FdwState = NULL;
resultRelInfo->ri_usesFdwDirectModify = false;
- resultRelInfo->ri_ConstraintExprs = NULL;
+ resultRelInfo->ri_CheckConstraintExprs = NULL;
resultRelInfo->ri_GeneratedExprsI = NULL;
resultRelInfo->ri_GeneratedExprsU = NULL;
resultRelInfo->ri_projectReturning = NULL;
@@ -1871,10 +1871,10 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
* nodetrees for rel's constraint expressions. Keep them in the per-query
* memory context so they'll survive throughout the query.
*/
- if (resultRelInfo->ri_ConstraintExprs == NULL)
+ if (resultRelInfo->ri_CheckConstraintExprs == NULL)
{
oldContext = MemoryContextSwitchTo(estate->es_query_cxt);
- resultRelInfo->ri_ConstraintExprs =
+ resultRelInfo->ri_CheckConstraintExprs =
(ExprState **) palloc0(ncheck * sizeof(ExprState *));
for (i = 0; i < ncheck; i++)
{
@@ -1886,7 +1886,7 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
checkconstr = stringToNode(check[i].ccbin);
checkconstr = (Expr *) expand_generated_columns_in_expr((Node *) checkconstr, rel, 1);
- resultRelInfo->ri_ConstraintExprs[i] =
+ resultRelInfo->ri_CheckConstraintExprs[i] =
ExecPrepareExpr(checkconstr, estate);
}
MemoryContextSwitchTo(oldContext);
@@ -1904,7 +1904,7 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
/* And evaluate the constraints */
for (i = 0; i < ncheck; i++)
{
- ExprState *checkconstr = resultRelInfo->ri_ConstraintExprs[i];
+ ExprState *checkconstr = resultRelInfo->ri_CheckConstraintExprs[i];
/*
* NOTE: SQL specifies that a NULL result from a constraint expression
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index e42f9f9f957..bc06fa6f5ea 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -546,8 +546,8 @@ typedef struct ResultRelInfo
/* list of WithCheckOption expr states */
List *ri_WithCheckOptionExprs;
- /* array of constraint-checking expr states */
- ExprState **ri_ConstraintExprs;
+ /* array of expr states for checking check constraints */
+ ExprState **ri_CheckConstraintExprs;
/*
* Arrays of stored generated columns ExprStates for INSERT/UPDATE/MERGE.
[parent: fb2ea12f42b9]