David Rowley <dgrowley@gmail.com> writes:
> On this thread
> http://www.postgresql.org/message-id/52C6F712.6040804@student.kit.edu there
> was some discussion around allowing push downs of quals that happen to be
> in every window clause of the sub query. I've quickly put together a patch
> which does this (see attached)
I think you should have check_output_expressions deal with this, instead.
Compare the existing test there for non-DISTINCT output columns.
> Oh and I know that my function var_exists_in_all_query_partition_by_clauses
> has no business in allpaths.c, I'll move it out as soon as I find a better
> home for it.
I might be wrong, but I think you could just embed that search loop in
check_output_expressions, and it wouldn't be too ugly.
regards, tom lane