Add docs about postgres_fdw's setting of search_path and other GUCs.
authorTom Lane
Sat, 15 Aug 2015 18:31:04 +0000 (14:31 -0400)
committerTom Lane
Sat, 15 Aug 2015 18:31:04 +0000 (14:31 -0400)
This behavior wasn't documented, but it should be because it's user-visible
in triggers and other functions executed on the remote server.
Per question from Adam Fuchs.

Back-patch to 9.3 where postgres_fdw was added.

doc/src/sgml/postgres-fdw.sgml

index 14b12e37dc6cc9fa78be3c1941c7d423aadbb052..7c922821e988ffde8711e8323ff310c8166187d4 100644 (file)
   
  
 
+  Remote Query Execution Environment
+
+  
+   In the remote sessions opened by postgres_fdw,
+   the  parameter is set to
+   just pg_catalog, so that only built-in objects are visible
+   without schema qualification.  This is not an issue for queries
+   generated by postgres_fdw itself, because it always
+   supplies such qualification.  However, this can pose a hazard for
+   functions that are executed on the remote server via triggers or rules
+   on remote tables.  For example, if a remote table is actually a view,
+   any functions used in that view will be executed with the restricted
+   search path.  It is recommended to schema-qualify all names in such
+   functions, or else attach SET search_path options
+   (see ) to such functions
+   to establish their expected search path environment.
+  
+
+  
+   postgres_fdw likewise establishes remote session settings
+   for the parameters ,
+   ,
+   and .  These are less likely
+   to be problematic than search_path, but can be handled
+   with function SET options if the need arises.
+  
+
+  
+   It is not recommended that you override this behavior by
+   changing the session-level settings of these parameters; that is likely
+   to cause postgres_fdw to malfunction.
+  
+
  
   Cross-Version Compatibility