Re: Row pattern recognition
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: assam258@gmail.com
Cc: Tatsuo Ishii <ishii@postgresql.org>, zsolt.parragi@percona.com,
sjjang112233@gmail.com, vik@postgresfriends.org, er@xs4all.nl, jacob.champion@enterprisedb.com, david.g.johnston@gmail.com, peter@eisentraut.org, li.evan.chao@gmail.com, pgsql-hackers@postgresql.org
Date: 2026-06-12T10:52:52Z
Lists: pgsql-hackers
Attachments
- v47-0003-refactor-volatile-expression-check.nocfbot (application/octet-stream)
- v47-0002-refactor-gram.y.nocfbot (application/octet-stream)
- v47-0006-refactor-transformDefineClause.nocfbot (application/octet-stream)
- v47-0004-refactor-validateRPRPatternVarCount.nocfbot (application/octet-stream)
- v47-0005-refactor-transformDefineClause.nocfbot (application/octet-stream)
- v47-0001-replace-some-AST-to-clause.nocfbot (application/octet-stream)
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/
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Adjust cross-version upgrade tests for seg_out() fix
- 3e3d7875e956 19 (unreleased) cited
-
Rationalize error comments in partition split/merge tests
- ecb2508aaf9b 19 (unreleased) cited
-
Add fast path for foreign key constraint checks
- 2da86c1ef9b5 19 (unreleased) cited
-
Fix assorted pretty-trivial memory leaks in the backend.
- e78d1d6d47dc 19 (unreleased) cited
-
Add temporal FOREIGN KEY contraints
- 89f908a6d0ac 18.0 cited
-
Add trailing commas to enum definitions
- 611806cd726f 17.0 cited
-
Remove obsolete executor cleanup code
- d060e921ea5a 17.0 cited