forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit00418c6
committed
Simplify plpgsql's check for simple expressions.
plpgsql wants to recognize expressions that it can execute directlyvia ExecEvalExpr() instead of going through the full SPI machinery.Originally the test for this consisted of recursively groveling throughthe post-planning expression tree to see if it contained only nodes thatplpgsql recognized as safe. That was a major maintenance headache, sinceit required updating plpgsql every time we added any kind of expressionnode. It was also kind of expensive, so over time we added variouspre-planning checks to try to short-circuit having to do that.Robert Haas pointed out that as of the SRF-processing changes in v10,particularly the addition of Query.hasTargetSRFs, there really isn'tany reason to make the recursive scan at all: the initial checks covereverything we really care about. We do have to make sure that thosechecks agree with what inline_function() considers, so that inliningof a function that formerly wasn't inlined can't cause an expressionconsidered simple to become non-simple.Hence, delete the recursive function exec_simple_check_node(), and tweakthose other tests to more exactly agree with inline_function(). Adjustsome comments and function naming to match.Discussion:https://postgr.es/m/CA+TgmoZGZpwdEV2FQWaVxA_qZXsQE1DAS5Fu8fwxXDNvfndiUQ@mail.gmail.com1 parenta4619b2 commit00418c6
2 files changed
+53
-339
lines changedLines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4445 | 4445 |
| |
4446 | 4446 |
| |
4447 | 4447 |
| |
| 4448 | + | |
| 4449 | + | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
4448 | 4453 |
| |
4449 | 4454 |
| |
4450 | 4455 |
| |
|
0 commit comments
Comments
(0)