klaussfreire(at)gmail(dot)com writes:
> So, I've been checking whether my SQL was wrong, and I really can't see the
> fault in it. It seems to be a planner error, generating erroneous results.
I've committed a patch for this. Thanks for the report!
regards, tom lane