aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-01-07 16:02:16 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-01-07 16:02:16 -0500
commit7c3abe3c92fd3a14a70bc2f888f936cd6fe28c0f (patch)
treead42bd2d3dfa871ec753a0457b9bc9ee776cd159 /src/backend/parser/parse_expr.c
parent3c40594e6eeabb3a8ad22aee93de3a19c41efdc2 (diff)
downloadpostgresql-7c3abe3c92fd3a14a70bc2f888f936cd6fe28c0f.tar.gz
postgresql-7c3abe3c92fd3a14a70bc2f888f936cd6fe28c0f.zip
Get rid of ParseState.p_value_substitute; use a columnref hook instead.
I noticed that p_value_substitute, which is a single-purpose kluge I added in 2002 (commit b0422b215), could be replaced by having domainAddConstraint install a parser hook that looks for the name "value". The parser hook code only dates back to 2009, so it's not surprising that we had to kluge this in 2002, but we can do it more cleanly now.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r--src/backend/parser/parse_expr.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 38c2535b65f..f62e45f8ac8 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -577,27 +577,6 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref)
/*
* Not known as a column of any range-table entry.
*
- * Consider the possibility that it's VALUE in a domain
- * check expression. (We handle VALUE as a name, not a
- * keyword, to avoid breaking a lot of applications that
- * have used VALUE as a column name in the past.)
- */
- if (pstate->p_value_substitute != NULL &&
- strcmp(colname, "value") == 0)
- {
- node = (Node *) copyObject(pstate->p_value_substitute);
-
- /*
- * Try to propagate location knowledge. This should
- * be extended if p_value_substitute can ever take on
- * other node types.
- */
- if (IsA(node, CoerceToDomainValue))
- ((CoerceToDomainValue *) node)->location = cref->location;
- break;
- }
-
- /*
* Try to find the name as a relation. Note that only
* relations already entered into the rangetable will be
* recognized.