summaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorTom Lane2013-07-23 22:21:19 +0000
committerTom Lane2013-07-23 22:21:19 +0000
commit10a509d82956dee14eb2011bd266cd3c728ae188 (patch)
treec806c2fcb115030a5c025a11a3dbf0aeefebecf2 /src/backend/optimizer
parentef655663c5069231e054c3514c3ee9b15b8a4f13 (diff)
Move strip_implicit_coercions() from optimizer to nodeFuncs.c.
Use of this function has spread into the parser and rewriter, so it seems like time to pull it out of the optimizer and put it into the more central nodeFuncs module. This eliminates the need to #include optimizer/clauses.h in most of the calling files, demonstrating that this function was indeed a bit outside the normal code reference patterns.
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/util/clauses.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 7ec6b0b30ba..506e9d49fc3 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -2071,62 +2071,6 @@ CommuteRowCompareExpr(RowCompareExpr *clause)
}
/*
- * strip_implicit_coercions: remove implicit coercions at top level of tree
- *
- * Note: there isn't any useful thing we can do with a RowExpr here, so
- * just return it unchanged, even if it's marked as an implicit coercion.
- */
-Node *
-strip_implicit_coercions(Node *node)
-{
- if (node == NULL)
- return NULL;
- if (IsA(node, FuncExpr))
- {
- FuncExpr *f = (FuncExpr *) node;
-
- if (f->funcformat == COERCE_IMPLICIT_CAST)
- return strip_implicit_coercions(linitial(f->args));
- }
- else if (IsA(node, RelabelType))
- {
- RelabelType *r = (RelabelType *) node;
-
- if (r->relabelformat == COERCE_IMPLICIT_CAST)
- return strip_implicit_coercions((Node *) r->arg);
- }
- else if (IsA(node, CoerceViaIO))
- {
- CoerceViaIO *c = (CoerceViaIO *) node;
-
- if (c->coerceformat == COERCE_IMPLICIT_CAST)
- return strip_implicit_coercions((Node *) c->arg);
- }
- else if (IsA(node, ArrayCoerceExpr))
- {
- ArrayCoerceExpr *c = (ArrayCoerceExpr *) node;
-
- if (c->coerceformat == COERCE_IMPLICIT_CAST)
- return strip_implicit_coercions((Node *) c->arg);
- }
- else if (IsA(node, ConvertRowtypeExpr))
- {
- ConvertRowtypeExpr *c = (ConvertRowtypeExpr *) node;
-
- if (c->convertformat == COERCE_IMPLICIT_CAST)
- return strip_implicit_coercions((Node *) c->arg);
- }
- else if (IsA(node, CoerceToDomain))
- {
- CoerceToDomain *c = (CoerceToDomain *) node;
-
- if (c->coercionformat == COERCE_IMPLICIT_CAST)
- return strip_implicit_coercions((Node *) c->arg);
- }
- return node;
-}
-
-/*
* Helper for eval_const_expressions: check that datatype of an attribute
* is still what it was when the expression was parsed. This is needed to
* guard against improper simplification after ALTER COLUMN TYPE. (XXX we