In match_eclasses_to_foreign_key_col(), there is this:

            if (em->em_is_child)
                continue;       /* ignore children here */

ISTM, it might as well be:

            Assert(!em->em_is_child);    /* no children yet */

That's because, I think it's still too early in query_planner() to be
expecting any child EC members.

Thanks,
Amit
diff --git a/src/backend/optimizer/path/equivclass.c b/src/backend/optimizer/path/equivclass.c
index 67bd760fb4..735bd7fdc6 100644
--- a/src/backend/optimizer/path/equivclass.c
+++ b/src/backend/optimizer/path/equivclass.c
@@ -2017,8 +2017,7 @@ match_eclasses_to_foreign_key_col(PlannerInfo *root,
 			EquivalenceMember *em = (EquivalenceMember *) lfirst(lc2);
 			Var		   *var;
 
-			if (em->em_is_child)
-				continue;		/* ignore children here */
+			Assert(!em->em_is_child);	/* no children yet */
 
 			/* EM must be a Var, possibly with RelabelType */
 			var = (Var *) em->em_expr;
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to