Improvements to SQL/MED documentation.
authorRobert Haas <rhaas@postgresql.org>
Mon, 25 Jul 2011 13:37:06 +0000 (09:37 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 25 Jul 2011 13:37:06 +0000 (09:37 -0400)
Laurenz Albe, somewhat modified by me.

doc/src/sgml/ddl.sgml
doc/src/sgml/fdwhandler.sgml

index ca6b8637934c972956bc3dc8029b5f114a9d84f8..c624fc2d9a23cb7c9d804384aa9f9acdd571a973 100644 (file)
@@ -3008,6 +3008,9 @@ ANALYZE measurement;
    <indexterm>
     <primary>foreign table</primary>
    </indexterm>
+   <indexterm>
+    <primary>user mapping</primary>
+   </indexterm>
 
    <para>
     <productname>PostgreSQL</productname> implements portions of the SQL/MED
@@ -3037,8 +3040,15 @@ ANALYZE measurement;
     tables</firstterm>, which define the structure of the remote data. A
     foreign table can be used in queries just like a normal table, but a
     foreign table has no storage in the PostgreSQL server.  Whenever it is
-    used, PostgreSQL asks the foreign data wrapper to fetch the data from the
-    external source.
+    used, <productname>PostgreSQL</productname> asks the foreign data wrapper
+    to fetch the data from the external source.
+   </para>
+
+   <para>
+    Accessing remote data may require authentication at the external
+    data source.  This information can be provided by a
+    <firstterm>user mapping</>, which can provide additional options based
+    on the current <productname>PostgreSQL</productname> role.
    </para>
 
    <para>
index 9ab712f6d18e1e6de26cd64883669c6370f1721c..76ff243f5d34db58815581b57fda2b14cd676f6a 100644 (file)
@@ -152,7 +152,9 @@ BeginForeignScan (ForeignScanState *node,
 </programlisting>
 
      Begin executing a foreign scan. This is called during executor startup.
-     It should perform any initialization needed before the scan can start.
+     It should perform any initialization needed before the scan can start,
+     but not start executing the actual scan (that should be done upon the
+     first call to <function>IterateForeignScan</>).
      The <structname>ForeignScanState</> node has already been created, but
      its <structfield>fdw_state</> field is still NULL.  Information about
      the table to scan is accessible through the