diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-17 17:25:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-17 17:25:52 +0000 |
commit | c81bfc244bf703296ed5571a65e15de522388a59 (patch) | |
tree | 69794689311c940df823c4e0bd78b3f33c17ef02 | |
parent | eddbf39756fb7d58f1bdc7582af7d6462410a3e1 (diff) | |
download | postgresql-c81bfc244bf703296ed5571a65e15de522388a59.tar.gz postgresql-c81bfc244bf703296ed5571a65e15de522388a59.zip |
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...
-rw-r--r-- | src/backend/optimizer/util/clauses.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 4858f985cff..52dd8c22ca7 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.229 2007/01/10 18:06:04 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.230 2007/01/17 17:25:52 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -1073,6 +1073,12 @@ is_strict_saop(ScalarArrayOpExpr *expr, bool falseOK) * may vary from one statement to the next. However, the expr's value * will be constant over any one scan of the current query, so it can be * used as, eg, an indexscan key. + * + * CAUTION: this function omits to test for one very important class of + * not-constant expressions, namely aggregates (Aggrefs). In current usage + * this is only applied to WHERE clauses and so a check for Aggrefs would be + * a waste of cycles; but be sure to also check contain_agg_clause() if you + * want to know about pseudo-constness in other contexts. */ bool is_pseudo_constant_clause(Node *clause) |