(unnamed)
text/plain
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 219681d6e88..f92fa793c10 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -613,6 +613,17 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref)
return node;
}
+ /*
+ * DEFINE clause in RPR does not allow to use table names.
+ */
+ if (pstate->p_expr_kind == EXPR_KIND_RPR_DEFINE &&
+ list_length(cref->fields) != 1)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("range var qualified name \"%s\" is not allowed in DEFINE clause",
+ NameListToString(cref->fields)),
+ parser_errposition(pstate, cref->location)));
+
/*----------
* The allowed syntaxes are:
*