Re: Row pattern recognition

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: assam258@gmail.com, 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-14T02:39:42Z
Lists: pgsql-hackers
On Sat, Jun 13, 2026 at 8:26 PM Tatsuo Ishii <ishii@postgresql.org> wrote:
>
> I have created v48 RPR (Row pattern recognition) patches based on the
> attached incremental patches against v47 patches. I have briefly
> looked through all the incremental patches. If I have missed
> something, I will follow up later.  The patches are based on the
> commit 3e3d7875e95 on the master branch.
>

get_windowclause_startup_tuples
do we need some comments for WindowClause->defineClause

src/backend/executor/README.rpr
  (2) Transcription to WindowClause
      - Copies rpPattern, rpSkipTo, initial fields

In transformRPR, we did this:
``wc->rpPattern = windef->rpCommonSyntax->rpPattern;``
Since this is an assignment, not a copy, is "Copies rpPattern" incorrect?

ISO reference typo: most occurrences use {ISO/IEC 19075},
but rpr_integration.sql and some places reference 9075-2:2016 instead of 19075.
We may need check all occurrences to ensure consistency.

In struct ResultRelInfo, we have fields like {ri_CheckConstraintExprs,
ri_WithCheckOptionExprs}.
Similarly, I want to rename WindowAggState->defineClauseList to
defineClauseExprs

I think the comment on function contain_rpr_walker can be removed,
since transformWithClause already explains it.

Is "judgment" really the right word?

I don't fully understand the purpose of eval_nav_offset_helper now.
Also, the branch where (isnull == true) and (offset < 0) appears
unreachable; it's never hit in the regression tests.
We should add some regression tests for these scenarios.



--
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 →
  1. Adjust cross-version upgrade tests for seg_out() fix

  2. Rationalize error comments in partition split/merge tests

  3. Add fast path for foreign key constraint checks

  4. Fix assorted pretty-trivial memory leaks in the backend.

  5. Add temporal FOREIGN KEY contraints

  6. Add trailing commas to enum definitions

  7. Remove obsolete executor cleanup code