summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorTom Lane2004-03-14 23:41:27 +0000
committerTom Lane2004-03-14 23:41:27 +0000
commit04226b640493a206b9927b8160fb48b864efcce6 (patch)
tree5e51ef7885a18ef48ba6e0220d58c03e549ddab8 /src/backend/utils/cache
parente1d08faf043242338973f30a1d1d158498ea7f04 (diff)
Tweak planner so that index expressions and predicates are matched to
queries without regard to whether coercions are stated explicitly or implicitly. Per suggestion from Stephan Szabo.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/relcache.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index ac0ee1a5e51..4900cfa5276 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.198 2004/02/25 19:41:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.199 2004/03/14 23:41:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2687,6 +2687,12 @@ RelationGetIndexExpressions(Relation relation)
result = (List *) eval_const_expressions((Node *) result);
+ /*
+ * Also mark any coercion format fields as "don't care", so that the
+ * planner can match to both explicit and implicit coercions.
+ */
+ set_coercionform_dontcare((Node *) result);
+
/* May as well fix opfuncids too */
fix_opfuncids((Node *) result);
@@ -2755,6 +2761,12 @@ RelationGetIndexPredicate(Relation relation)
result = (List *) eval_const_expressions((Node *) result);
+ /*
+ * Also mark any coercion format fields as "don't care", so that the
+ * planner can match to both explicit and implicit coercions.
+ */
+ set_coercionform_dontcare((Node *) result);
+
/* Also convert to implicit-AND format */
result = make_ands_implicit((Expr *) result);