Rename a node field for clarity
authorPeter Eisentraut <[email protected]>
Fri, 28 Mar 2025 08:50:01 +0000 (09:50 +0100)
committerPeter Eisentraut <[email protected]>
Fri, 28 Mar 2025 08:50:01 +0000 (09:50 +0100)
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
src/include/nodes/execnodes.h

index e9bd98c7738c0c8b86a343cb8648293c3d51c441..1cd4dbd2b90d6d79bb39ad9f77ddb39eba519778 100644 (file)
@@ -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
index e42f9f9f9574ea1ec75f1ec03c6512b8ef9aa228..bc06fa6f5ea9070d3fc5945a684d5e0c9c24001f 100644 (file)
@@ -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.