Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d6b582

Browse files
committed
Disallow aggregate functions in rule WHERE clauses. Per gripe from
Fritz Lehmann-Grube back in January.
1 parentea79457 commit6d6b582

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/parser/analyze.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
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 $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -1454,6 +1454,10 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
14541454
if (length(pstate->p_rtable)!=2)/* naughty, naughty... */
14551455
elog(ERROR,"Rule WHERE condition may not contain references to other relations");
14561456

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+
14571461
/* save info about sublinks in where clause */
14581462
qry->hasSubLinks=pstate->p_hasSubLinks;
14591463

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp