|
6 | 6 | * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
7 | 7 | * Portions Copyright (c) 1994, Regents of the University of California
|
8 | 8 | *
|
9 |
| - *$Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.251 2002/10/14 22:14:35 tgl Exp $ |
| 9 | + *$Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.252 2002/10/20 00:31:53 tgl Exp $ |
10 | 10 | *
|
11 | 11 | *-------------------------------------------------------------------------
|
12 | 12 | */
|
@@ -1454,6 +1454,10 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
|
1454 | 1454 | if (length(pstate->p_rtable)!=2)/* naughty, naughty... */
|
1455 | 1455 | elog(ERROR,"Rule WHERE condition may not contain references to other relations");
|
1456 | 1456 |
|
| 1457 | +/* aggregates not allowed (but subselects are okay) */ |
| 1458 | +if (contain_agg_clause(stmt->whereClause)) |
| 1459 | +elog(ERROR,"Rule WHERE condition may not contain aggregate functions"); |
| 1460 | + |
1457 | 1461 | /* save info about sublinks in where clause */
|
1458 | 1462 | qry->hasSubLinks=pstate->p_hasSubLinks;
|
1459 | 1463 |
|
|