Improved version of patch to protect pg_get_expr() against misuse:
Tom Lane <tgl@sss.pgh.pa.us>
Improved version of patch to protect pg_get_expr() against misuse: look through join alias Vars to avoid breaking join queries, and move the test to someplace where it will catch more possible ways of calling a function. We still ought to throw away the whole thing in favor of a data-type-based solution, but that's not feasible in the back branches. Completion of back-port of my patch of yesterday.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/parse_expr.c | modified | +2 −87 |
| src/backend/parser/parse_func.c | modified | +112 −1 |
| src/backend/parser/parse_oper.c | modified | +7 −1 |
| src/include/parser/parse_func.h | modified | +3 −1 |