aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/indexcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r--src/backend/commands/indexcmds.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index a0840d1bf06..f6772686091 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -941,17 +941,9 @@ static void
CheckPredicate(Expr *predicate)
{
/*
- * We don't currently support generation of an actual query plan for a
- * predicate, only simple scalar expressions; hence these restrictions.
+ * transformExpr() should have already rejected subqueries, aggregates,
+ * and window functions, based on the EXPR_KIND_ for a predicate.
*/
- if (contain_subplans((Node *) predicate))
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot use subquery in index predicate")));
- if (contain_agg_clause((Node *) predicate))
- ereport(ERROR,
- (errcode(ERRCODE_GROUPING_ERROR),
- errmsg("cannot use aggregate in index predicate")));
/*
* A predicate using mutable functions is probably wrong, for the same
@@ -1072,18 +1064,10 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
expr);
/*
- * We don't currently support generation of an actual query
- * plan for an index expression, only simple scalar
- * expressions; hence these restrictions.
+ * transformExpr() should have already rejected subqueries,
+ * aggregates, and window functions, based on the EXPR_KIND_
+ * for an index expression.
*/
- if (contain_subplans(expr))
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot use subquery in index expression")));
- if (contain_agg_clause(expr))
- ereport(ERROR,
- (errcode(ERRCODE_GROUPING_ERROR),
- errmsg("cannot use aggregate function in index expression")));
/*
* A expression using mutable functions is probably wrong,