*
* 1) Join type is INNER or OUTER (one of LEFT/RIGHT/FULL)
* 2) Both outer and inner portions are safe to push-down
- * 3) All foreign tables in the join belong to the same foreign server and use
- * the same user mapping.
- * 4) All join conditions are safe to push down
- * 5) No relation has local filter (this can be relaxed for INNER JOIN, if we
+ * 3) All join conditions are safe to push down
+ * 4) No relation has local filter (this can be relaxed for INNER JOIN, if we
* can move unpushable clauses upwards in the join tree).
*/
static bool
/*
* 5. If inner and outer relations are foreign tables (or joins) belonging
- * to the same server, give the FDW a chance to push down joins.
+ * to the same server and using the same user mapping, give the FDW a
+ * chance to push down joins.
*/
if (joinrel->fdwroutine &&
joinrel->fdwroutine->GetForeignJoinPaths)
* in just as for a baserel, except we don't bother with lateral_vars.
*
* If the relation is either a foreign table or a join of foreign tables that
- * all belong to the same foreign server, these fields will be set:
+ * all belong to the same foreign server and use the same user mapping, these
+ * fields will be set:
*
* serverid - OID of foreign server, if foreign table (else InvalidOid)
+ * umid - OID of user mapping, if foreign table (else InvalidOid)
* fdwroutine - function hooks for FDW, if foreign table (else NULL)
* fdw_private - private state for FDW, if foreign table (else NULL)
*