- if (!parsetree->hasAggs)
- parsetree->hasAggs = checkExprHasAggs(copy);
- if (!parsetree->hasSubLinks)
- parsetree->hasSubLinks = checkExprHasSubLink(copy);
-}
-
-/*
- * Add the given havingQual to the one already contained in the parsetree
- * just as AddQual does for the normal 'where' qual
- */
-void
-AddHavingQual(Query *parsetree, Node *havingQual)
-{
- Node *copy;
-
- if (havingQual == NULL)
- return;
-
- if (parsetree->commandType == CMD_UTILITY)
- {
- /*
- * There's noplace to put the qual on a utility statement.
- *
- * See comments in AddQual for motivation.
- */
- if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
- return;
- else
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("conditional utility statements are not implemented")));
- }
-
- if (parsetree->setOperations != NULL)
- {
- /*
- * There's noplace to put the qual on a setop statement, either.
- * (This could be fixed, but right now the planner simply ignores
- * any qual condition on a setop query.)
- */
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("conditional UNION/INTERSECT/EXCEPT statements are not implemented")));
- }
-
- /* INTERSECT want's the original, but we need to copy - Jan */
- copy = copyObject(havingQual);
-
- parsetree->havingQual = make_and_qual(parsetree->havingQual,
- copy);