From 6b124015a6e429bb17b5af120c92699302563632 Mon Sep 17 00:00:00 2001 From: Henson Choi Date: Mon, 22 Jun 2026 23:35:10 +0900 Subject: [PATCH] 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 ada86e73eaa..ac29c26e208 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 d65380468c0..39254aa4145 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