Improved version of patch to protect pg_get_expr() against misuse:

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 9e6dc1372f7ece296fc4a02b4c69f5ef86366acc
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-07-30T17:57:07Z
Releases: 8.3.12
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