Update more comments for 96198d94cb7adc664bda341842dc8db671d8be72.
authorRobert Haas <rhaas@postgresql.org>
Mon, 14 Mar 2016 18:27:11 +0000 (14:27 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 14 Mar 2016 18:29:12 +0000 (14:29 -0400)
Etsuro Fujita, reviewed (though not completely endorsed) by Ashutosh
Bapat, and slightly expanded by me.

contrib/postgres_fdw/postgres_fdw.c
src/backend/optimizer/path/joinpath.c
src/include/nodes/relation.h

index 40bffd6f6cb305e275798aaf92f36da61dbcb7a9..aa745f237e259880c272285b73ecfd4a66be5ae4 100644 (file)
@@ -3349,10 +3349,8 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
  *
  * 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
index 3b898dafee1e3d63912e2b4f0ab27e2f9a0d6e68..f3aced3c93145e59f439b7e25064a509341e97ce 100644 (file)
@@ -213,7 +213,8 @@ add_paths_to_joinrel(PlannerInfo *root,
 
    /*
     * 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)
index 641728bb0f41a9a0445212e1060210350f88020b..bdea72c3f4741aa5bfae0f402790678d3a63420c 100644 (file)
@@ -448,9 +448,11 @@ typedef struct PlannerInfo
  *     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)
  *