aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_relation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser/parse_relation.c')
-rw-r--r--src/backend/parser/parse_relation.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 4df92ee310c..de4bf093ee9 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.93 2004/04/02 19:06:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.94 2004/04/18 18:12:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -531,13 +531,14 @@ scanRTEForColumn(ParseState *pstate, RangeTblEntry *rte, char *colname)
}
/*
- * colnameToVar
+ * colNameToVar
* Search for an unqualified column name.
* If found, return the appropriate Var node (or expression).
* If not found, return NULL. If the name proves ambiguous, raise error.
+ * If localonly is true, only names in the innermost query are considered.
*/
Node *
-colnameToVar(ParseState *pstate, char *colname)
+colNameToVar(ParseState *pstate, char *colname, bool localonly)
{
Node *result = NULL;
ParseState *orig_pstate = pstate;
@@ -594,8 +595,8 @@ colnameToVar(ParseState *pstate, char *colname)
}
}
- if (result != NULL)
- break; /* found */
+ if (result != NULL || localonly)
+ break; /* found, or don't want to look at parent */
pstate = pstate->parentParseState;
levels_up++;