From ade05c5601e28d1740b9f63e62f82f90e93025d3 Mon Sep 17 00:00:00 2001 From: Henson Choi Date: Mon, 22 Jun 2026 23:35:10 +0900 Subject: [PATCH v50 25/29] Reword the row pattern variable-limit error The error for exceeding the pattern-variable limit said "too many pattern variables" with "Maximum is N." as detail. Spell out "row pattern" in both, so the message is unambiguous in the RPR context. Jian He proposed merging the maximum into a single primary message; this keeps the primary-message / errdetail split per PostgreSQL convention. --- src/backend/parser/parse_rpr.c | 4 ++-- src/test/regress/expected/rpr_base.out | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/parser/parse_rpr.c b/src/backend/parser/parse_rpr.c index ed12190cb06..4753825febd 100644 --- a/src/backend/parser/parse_rpr.c +++ b/src/backend/parser/parse_rpr.c @@ -238,8 +238,8 @@ validateRPRPatternVarCount(ParseState *pstate, RPRPatternNode *node, if (list_length(*varNames) > RPR_VARID_MAX) ereport(ERROR, errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("too many pattern variables"), - errdetail("Maximum is %d.", RPR_VARID_MAX + 1), + errmsg("too many row pattern variables"), + errdetail("The maximum number of row pattern variables is %d.", RPR_VARID_MAX + 1), parser_errposition(pstate, exprLocation((Node *) node))); diff --git a/src/test/regress/expected/rpr_base.out b/src/test/regress/expected/rpr_base.out index b385e972e7f..a0fe13e03c1 100644 --- a/src/test/regress/expected/rpr_base.out +++ b/src/test/regress/expected/rpr_base.out @@ -7394,10 +7394,10 @@ WINDOW w AS ( V221 AS val > 0, V222 AS val > 0, V223 AS val > 0, V224 AS val > 0, V225 AS val > 0, V226 AS val > 0, V227 AS val > 0, V228 AS val > 0, V229 AS val > 0, V230 AS val > 0, V231 AS val > 0, V232 AS val > 0, V233 AS val > 0, V234 AS val > 0, V235 AS val > 0, V236 AS val > 0, V237 AS val > 0, V238 AS val > 0, V239 AS val > 0, V240 AS val > 0 ); -ERROR: too many pattern variables +ERROR: too many row pattern variables LINE 5: ...V230 V231 V232 V233 V234 V235 V236 V237 V238 V239 V240 V241) ^ -DETAIL: Maximum is 240. +DETAIL: The maximum number of row pattern variables is 240. -- Test: Pattern nesting at maximum depth (depth 253) -- Note: 253 nested GROUP{3,7}? quantifiers; reluctant quantifiers are not -- subject to quantifier multiplication, so the nesting (and depth 253) is -- 2.50.1 (Apple Git-155)