pgsql-bugs(at)postgresql(dot)org writes:
> INTERSECT fails
I believe this is fixed in current sources (7.2-to-be). The problem
is with INTERSECT (or EXCEPT) as the input to another INTERSECT/EXCEPT.
You could work around it in 7.1 by doing one INTERSECT into a temp
table and then intersecting with that.
regards, tom lane