diff options
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r-- | src/backend/parser/parse_expr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 9f567f4bf41..059cb7097c7 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -2140,6 +2140,14 @@ transformRowExpr(ParseState *pstate, RowExpr *r, bool allowDefault) newr->args = transformExpressionList(pstate, r->args, pstate->p_expr_kind, allowDefault); + /* Disallow more columns than will fit in a tuple */ + if (list_length(newr->args) > MaxTupleAttributeNumber) + ereport(ERROR, + (errcode(ERRCODE_TOO_MANY_COLUMNS), + errmsg("ROW expressions can have at most %d entries", + MaxTupleAttributeNumber), + parser_errposition(pstate, r->location))); + /* Barring later casting, we consider the type RECORD */ newr->row_typeid = RECORDOID; newr->row_format = COERCE_IMPLICIT_CAST; |