Re: Row pattern recognition

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: assam258(at)gmail(dot)com
Cc: jian(dot)universality(at)gmail(dot)com, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2026-09-08 04:03:43
Message-ID: 20260908.130343.1650201259279941647.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Henson,

> Before you start, one thing has changed under us. SQL/PGQ was
> reverted from master yesterday (b1f106c80cb).

Yeah, I noticed that too.

> Rebasing v51 and the
> increment onto current master raises a handful of conflicts, all
> mechanical, and then breaks on something that raised none.
>
> The conflicts first. Five hunks in three commits, all of the same
> shape: SQL/PGQ had added something, RPR added its own entry next to
> it, and the revert took the SQL/PGQ half away.
>
> gram.y the %type block, the keyword token list (DESTINATION
> next to our DEFINE), and the %nonassoc list before
> %left Op OPERATOR
> parse_agg.c EXPR_KIND_PROPGRAPH_PROPERTY next to
> EXPR_KIND_RPR_DEFINE
> parse_expr.c the same
> nodeFuncs.c T_GraphElementPattern and T_GraphPattern next to
> T_RPCommonSyntax and T_RPRPatternNode
>
> In each, the resolution is to keep our side and drop theirs.
>
> "|" is the one that did not announce itself. The lexer change lives
> in scan.l, which no RPR commit touches, so it came away with the
> revert and raised no conflict at all. RPR still needs it.
>
> Without it a lone "|" arrives as an Op, row_pattern_alt never fires,
> and PATTERN (A | B) fails with "unsupported quantifier".
>
> What made it work was SQL/PGQ (2f094e7ac69). It needed a lone "|"
> for label disjunction in GRAPH_TABLE, so that an element pattern
> could be written as MATCH (a IS vl1 | vl2).
>
> RPR's alternation was then written against that token.
> row_pattern_alt does the same thing one level up, and the handling
> around it assumes "|" arrives separately. We extended what SQL/PGQ
> had put in place, so with SQL/PGQ gone RPR has to carry the
> groundwork itself.
>
> The attached nocfbot-0002-pipe-single-character-token.txt does that.

Thanks for the patch. I am going to post v52, which is just rebasing
plus one small fix for a compiler warning which makes CFBot angry.

----------------------------------------------------------------
Run echo "::group::configure"
configure
execRPR.c:1361:14: error: unused variable 'pattern' [-Werror,-Wunused-variable]
1361 | RPRPattern *pattern = winstate->rpPattern;
| ^~~~~~~
1 error generated.
make[3]: *** [<builtin>: execRPR.o] Error 1
----------------------------------------------------------------

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-09-08 04:22:43 RE: Follow-up review items for update_deleted
Previous Message Chao Li 2026-09-08 03:54:21 Re: Introducing find_all_inheritors_ordered()