From 7c3abe3c92fd3a14a70bc2f888f936cd6fe28c0f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 7 Jan 2017 16:02:16 -0500 Subject: 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. --- src/backend/parser/parse_expr.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/backend/parser/parse_expr.c') 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. -- cgit v1.2.3