Julien Rouhaud <rjuju123@gmail.com> writes:
> I'm not sure why you couldn't implement an Oracle-style outer join
> with such a hook?
Try it.
> The requirement is that the parser can't leak any
> node that the rest of the system doesn't know about, but you can do
> what you want inside the parser.
That's not what the patch actually does, though. It only replaces
the grammar, not semantic analysis. So you couldn't associate the
(+)-decorated WHERE clause with the appropriate join. (And no,
I will not accept that it's okay to perform catalog lookups in
the grammar to get around that. See comment at the head of gram.y.)
In general, I'm having a hard time believing that anything very
interesting can be done at only the grammar level without changing
the parse analysis phase. That's not unrelated to the restriction
that the grammar can't do catalog accesses. Maybe with some fundamental
restructuring, we could get around that issue ... but this patch isn't
doing any fundamental restructuring, it's just putting a hook where it's
easy to do so. We've often found that such hooks aren't as useful as
they initially seem.
regards, tom lane