Skip to content

Commit c81bfc2

Browse files
committed
Add a note pointing out that is_pseudo_constant_clause() doesn't check
for aggregates. This is OK for current uses but could burn somebody someday...
1 parent eddbf39 commit c81bfc2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/optimizer/util/clauses.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.229 2007/01/10 18:06:04 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.230 2007/01/17 17:25:52 tgl Exp $
1212
*
1313
* HISTORY
1414
* AUTHOR DATE MAJOR EVENT
@@ -1073,6 +1073,12 @@ is_strict_saop(ScalarArrayOpExpr *expr, bool falseOK)
10731073
* may vary from one statement to the next. However, the expr's value
10741074
* will be constant over any one scan of the current query, so it can be
10751075
* used as, eg, an indexscan key.
1076+
*
1077+
* CAUTION: this function omits to test for one very important class of
1078+
* not-constant expressions, namely aggregates (Aggrefs). In current usage
1079+
* this is only applied to WHERE clauses and so a check for Aggrefs would be
1080+
* a waste of cycles; but be sure to also check contain_agg_clause() if you
1081+
* want to know about pseudo-constness in other contexts.
10761082
*/
10771083
bool
10781084
is_pseudo_constant_clause(Node *clause)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy