Index: initsplan.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v retrieving revision 1.123.2.7 diff -c -r1.123.2.7 initsplan.c *** initsplan.c 4 Oct 2007 20:44:55 -0000 1.123.2.7 --- initsplan.c 24 Oct 2007 20:34:08 -0000 *************** *** 625,630 **** --- 625,631 ---- * rel in the lower OJ's min_righthand, not its whole syn_righthand. */ if (bms_overlap(left_rels, otherinfo->syn_righthand) && + bms_overlap(clause_relids, otherinfo->syn_righthand) && !bms_overlap(strict_relids, otherinfo->min_righthand)) { min_lefthand = bms_add_members(min_lefthand,