Hi.
Based on https://github.com/assam258-5892/postgres/commits/RPR
Here are more minor review comments:

v47-0001-replace-some-AST-to-clause.nocfbot
Replace some "AST" to "clause".

v47-0002-refactor-gram.y.nocfbot
group Op and trailing ALT into one IF condition, this might improve readability.

v47-0003-refactor-volatile-expression-check.nocfbot

validate_rpr_define_volatility function, along with its helper
functions is removed.
contain_volatile_functions() already covers both volatile FuncExpr callees and
NextValueExpr, so a separate walker is not needed. The trade-off is that we lose
the error cursor position, but that seems better than to maintaining extra code.

The check is also moved to after preprocess_expression(), following the same
pattern as contain_volatile_functions_after_planning.

v47-0004-refactor-validateRPRPatternVarCount.nocfbot

validateRPRPatternVarCount() is recursive. Using the `rpDefs != NULL` sentinel
to gate the "DEFINE variable not used in PATTERN" check at the outermost call
level is awkward. That cross-check only needs to run once; it is better
expressed in the caller, transformDefineClause().

v47-0005-refactor-transformDefineClause.nocfbot

coerce_to_boolean() was deferred to a second pass over the completed
defineClause list, meaning pull_var_clause() ran on an expression that had not
yet been fully coerced/transformed. The more intuitively order should be:
transformExpr → coerce_to_boolean → pull_var_clause, so pull_var_clause always
sees the final expression form.

v47-0006-refactor-transformDefineClause.nocfbot

The allowed nav-expression combination is limited, therefore,
has_column_ref is not necessary.
Column reference checks can use contain_var_clause, and it's cheap.

Also, I made the following error message change:

-ERROR:  row pattern navigation offset must be a run-time constant
+ERROR:  row pattern navigation offset expression must not contain
column references



--
jian
https://www.enterprisedb.com/

Attachment: v47-0003-refactor-volatile-expression-check.nocfbot
Description: Binary data

Attachment: v47-0002-refactor-gram.y.nocfbot
Description: Binary data

Attachment: v47-0006-refactor-transformDefineClause.nocfbot
Description: Binary data

Attachment: v47-0004-refactor-validateRPRPatternVarCount.nocfbot
Description: Binary data

Attachment: v47-0005-refactor-transformDefineClause.nocfbot
Description: Binary data

Attachment: v47-0001-replace-some-AST-to-clause.nocfbot
Description: Binary data

Reply via email to