summaryrefslogtreecommitdiff
path: root/src/include/rewrite
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-03-10 23:21:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-03-10 23:21:26 +0000
commit595ed2a8550e34c0abe64569a104d92ad077ec08 (patch)
tree004764220f537256d96637d5a119fd2086ed40ec /src/include/rewrite
parent609e32b929cf8684f8ae3a2b9f1655b372fb8b85 (diff)
downloadpostgresql-595ed2a8550e34c0abe64569a104d92ad077ec08.tar.gz
Make the behavior of HAVING without GROUP BY conform to the SQL spec.
Formerly, if such a clause contained no aggregate functions we mistakenly treated it as equivalent to WHERE. Per spec it must cause the query to be treated as a grouped query of a single group, the same as appearance of aggregate functions would do. Also, the HAVING filter must execute after aggregate function computation even if it itself contains no aggregate functions.
Diffstat (limited to 'src/include/rewrite')
-rw-r--r--src/include/rewrite/rewriteManip.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index 106f76fdc7..d53f72878e 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/rewrite/rewriteManip.h,v 1.39 2004/12/31 22:03:41 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/rewrite/rewriteManip.h,v 1.40 2005/03/10 23:21:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,7 +31,6 @@ extern bool attribute_used(Node *node, int rt_index, int attno,
extern Query *getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr);
extern void AddQual(Query *parsetree, Node *qual);
-extern void AddHavingQual(Query *parsetree, Node *havingQual);
extern void AddInvertedQual(Query *parsetree, Node *qual);
extern bool checkExprHasAggs(Node *node);