diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 334b9b42bd..cdf9c5c78a 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -2106,20 +2106,12 @@ findTargetlistEntrySQL92(ParseState *pstate, Node *node, List **tlist, } } } - if (IsA(node, A_Const)) + if (IsA(node, A_Const) && IsA(&castNode(A_Const, node)->val, Integer)) { A_Const *aconst = castNode(A_Const, node); int targetlist_pos = 0; int target_pos; - if (!IsA(&aconst->val, Integer)) - ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), - /* translator: %s is name of a SQL construct, eg ORDER BY */ - errmsg("non-integer constant in %s", - ParseExprKindName(exprKind)), - parser_errposition(pstate, aconst->location))); - target_pos = intVal(&aconst->val); foreach(tl, *tlist) {