KaiGai Kohei <kai...@ak.jp.nec.com> writes:
> Stephen Frost wrote:
>> * Tom Lane (t...@sss.pgh.pa.us) wrote:
>>> On the whole I think we have to go back to the original plan of
>>> recursively searching the query's expressions after we've finished all
>>> the transformations (and have a completed jointree to refer to).
>> 
>> Honestly, I like this approach.

> I agree with Stephen's opinion.
> Indeed, the walker approach requires additional steps during query
> parsing, but the code obviousness is a significant factor from the
> point of view of security.

On looking closer, though, it's *still* messy and unobvious :-(.
There is no single place in the parser where we have the complete
multi-level query tree available in a convenient form for this sort of
postprocessing.

I've thought of a less painful variant of my third option: instead of
making a permanent addition to RangeTblEntry, we can have a transient
data structure attached to ParseState that lets us find the JoinExpr
nodes for already-parsed joins.  I'm going to try that next.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to