]> granicus.if.org Git - postgresql/commitdiff
Add a comment noting that FDWs don't have to implement EXCEPT or LIMIT TO.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 31 Dec 2015 22:59:10 +0000 (17:59 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 31 Dec 2015 22:59:10 +0000 (17:59 -0500)
postgresImportForeignSchema pays attention to IMPORT's EXCEPT and LIMIT TO
options, but only as an efficiency hack, not for correctness' sake.  The
FDW documentation does explain that, but someone using postgres_fdw.c
as a coding guide might not remember it, so let's add a comment here.
Per question from Regina Obe.

contrib/postgres_fdw/postgres_fdw.c

index f501c6c5beaf3954334942bbc9c76b5d4f21a1fc..129357fa8bf8b3ca8405d4e0544f9a4dfc716554 100644 (file)
@@ -2892,7 +2892,11 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
 
                /*
                 * Fetch all table data from this schema, possibly restricted by
-                * EXCEPT or LIMIT TO.
+                * EXCEPT or LIMIT TO.  (We don't actually need to pay any attention
+                * to EXCEPT/LIMIT TO here, because the core code will filter the
+                * statements we return according to those lists anyway.  But it
+                * should save a few cycles to not process excluded tables in the
+                * first place.)
                 *
                 * Note: because we run the connection with search_path restricted to
                 * pg_catalog, the format_type() and pg_get_expr() outputs will always