"Mario Weilguni" <mario(dot)weilguni(at)icomedias(dot)com> writes:
> It seems like the planner is pulling the last where condition into the
> second left join, evaluating it in wrong order.
Can you try this on 8.1 branch tip? It sounds suspiciously similar to
an already-fixed issue (see reports from Sebastian Bck around
mid-November). You haven't provided a complete test case so I really
can't investigate for myself ...
regards, tom lane