Jan Wieck wrote:
>
> There is another thing that I would like to have. The current
> rule system tries to turn a qualification that uses an
> aggregate column of a view into a subquery. This is because
> the planner doesn't support plain aggregate expressions in
> the qualification. If it would be possible to have another
> type of Var node that points to a targetlist entry, we could
> put the aggregates from the qualification into junk TLE's.
This thing would also handled by subqueries in FROM!
Having support in planner/executor for queries like this:
select * from A, (select c, max(d) as m from B group by c) SQ
where SQ.c = A.x and SQ.m = A.y
rule system will be able to put _any_ VIEW' query into
FROM clause...
Vadim