aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-11-08 16:52:49 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-11-08 16:52:49 -0500
commitdcc55dd21aa2ba18b28ba9fa441885ef9c99d3c6 (patch)
tree08de7430b4344888ecdbe65a0287c0fd13eb959b /src/backend/optimizer
parent75af5ae9c017d70531bd49178adfd3103cd40a76 (diff)
downloadpostgresql-dcc55dd21aa2ba18b28ba9fa441885ef9c99d3c6.tar.gz
postgresql-dcc55dd21aa2ba18b28ba9fa441885ef9c99d3c6.zip
Rename ResolveNew() to ReplaceVarsFromTargetList(), and tweak its API.
This function currently lacks the option to throw error if the provided targetlist doesn't have any matching entry for a Var to be replaced. Two of the four existing call sites would be better off with an error, as would the usage in the pending auto-updatable-views patch, so it seems past time to extend the API to support that. To do so, replace the "event" parameter (historically of type CmdType, though it was declared plain int) with a special-purpose enum type. It's unclear whether this function might be called by third-party code. Since many C compilers wouldn't warn about a call site continuing to use the old calling convention, rename the function to forcibly break any such code that hasn't been updated. The old name was none too well chosen anyhow.
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/path/allpaths.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 458dae0489c..3a5efa2114e 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -1835,10 +1835,10 @@ subquery_push_qual(Query *subquery, RangeTblEntry *rte, Index rti, Node *qual)
* This step also ensures that when we are pushing into a setop tree,
* each component query gets its own copy of the qual.
*/
- qual = ResolveNew(qual, rti, 0, rte,
- subquery->targetList,
- CMD_SELECT, 0,
- &subquery->hasSubLinks);
+ qual = ReplaceVarsFromTargetList(qual, rti, 0, rte,
+ subquery->targetList,
+ REPLACEVARS_REPORT_ERROR, 0,
+ &subquery->hasSubLinks);
/*
* Now attach the qual to the proper place: normally WHERE, but if the