Skip to content

Commit 9a9ead1

Browse files
committed
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
1 parent fb2ea12 commit 9a9ead1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/backend/executor/execMain.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
13711371
resultRelInfo->ri_projectNewInfoValid = false;
13721372
resultRelInfo->ri_FdwState = NULL;
13731373
resultRelInfo->ri_usesFdwDirectModify = false;
1374-
resultRelInfo->ri_ConstraintExprs = NULL;
1374+
resultRelInfo->ri_CheckConstraintExprs = NULL;
13751375
resultRelInfo->ri_GeneratedExprsI = NULL;
13761376
resultRelInfo->ri_GeneratedExprsU = NULL;
13771377
resultRelInfo->ri_projectReturning = NULL;
@@ -1871,10 +1871,10 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
18711871
* nodetrees for rel's constraint expressions. Keep them in the per-query
18721872
* memory context so they'll survive throughout the query.
18731873
*/
1874-
if (resultRelInfo->ri_ConstraintExprs == NULL)
1874+
if (resultRelInfo->ri_CheckConstraintExprs == NULL)
18751875
{
18761876
oldContext = MemoryContextSwitchTo(estate->es_query_cxt);
1877-
resultRelInfo->ri_ConstraintExprs =
1877+
resultRelInfo->ri_CheckConstraintExprs =
18781878
(ExprState **) palloc0(ncheck * sizeof(ExprState *));
18791879
for (i = 0; i < ncheck; i++)
18801880
{
@@ -1886,7 +1886,7 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
18861886

18871887
checkconstr = stringToNode(check[i].ccbin);
18881888
checkconstr = (Expr *) expand_generated_columns_in_expr((Node *) checkconstr, rel, 1);
1889-
resultRelInfo->ri_ConstraintExprs[i] =
1889+
resultRelInfo->ri_CheckConstraintExprs[i] =
18901890
ExecPrepareExpr(checkconstr, estate);
18911891
}
18921892
MemoryContextSwitchTo(oldContext);
@@ -1904,7 +1904,7 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
19041904
/* And evaluate the constraints */
19051905
for (i = 0; i < ncheck; i++)
19061906
{
1907-
ExprState *checkconstr = resultRelInfo->ri_ConstraintExprs[i];
1907+
ExprState *checkconstr = resultRelInfo->ri_CheckConstraintExprs[i];
19081908

19091909
/*
19101910
* NOTE: SQL specifies that a NULL result from a constraint expression

src/include/nodes/execnodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,8 @@ typedef struct ResultRelInfo
546546
/* list of WithCheckOption expr states */
547547
List *ri_WithCheckOptionExprs;
548548

549-
/* array of constraint-checking expr states */
550-
ExprState **ri_ConstraintExprs;
549+
/* array of expr states for checking check constraints */
550+
ExprState **ri_CheckConstraintExprs;
551551

552552
/*
553553
* Arrays of stored generated columns ExprStates for INSERT/UPDATE/MERGE.

0 commit comments

Comments
 (0)