Subject: Improve FDW document (for 9.1)

From: Shigeru Hanada <[email-masked]>
Date: Thu, 30 Jun 2011 19:32:00 +0900

Hi,

During reading Albe's patch for FDW validator attached to "Bug in
SQL/MED?" posted to pgsql-hackers[1], I noticed that neither ALTER
commands nor USER MAPPING is mentioned in the description of FDW
validator in "Writing A Foreign Data Wrapper"[2].  The validator
function is also called for ALTER commands and USER MAPPING
manipulation, if any FDW option remains.

FYI, Albe's patch is for calling validator even if no option remains.

[1]http://archives.postgresql.org/pgsql-hackers/2011-06/msg02230.php
[2]http://developer.postgresql.org/pgdocs/postgres/fdwhandler.html

Please find attached a patch which adds a mention of ALTER and USER MAPPING.

Regards,
-- 
Shigeru Hanada
diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index c8ae861..c17c540 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -39,13 +39,18 @@
 
    <para>
     The validator function is responsible for validating options given in the
-    <command>CREATE FOREIGN DATA WRAPPER</command>, <command>CREATE
-    SERVER</command> and <command>CREATE FOREIGN TABLE</command> commands.
+    <command>CREATE</command> and <command>ALTER</command> commands for
+    <literal>FOREIGN DATA WRAPPER</>, <literal>SERVER</>,
+    <literal>USER MAPPING</> and <literal>FOREIGN TABLE</>.  To make it
+    possible to enforce required option, the validator function is called for
+    every such command even if the option list was empty as a result of
+    dropping all options.
     The validator function must be registered as taking two arguments, a text
     array containing the options to be validated, and an OID representing the
     type of object the options are associated with (in the form of the OID
     of the system catalog the object would be stored in).  If no validator
-    function is supplied, the options are not checked at object creation time.
+    function is supplied, the options are not checked at object creation time
+    or object alteration time.
    </para>
 
    <para>

---

From: Tom Lane <[email-masked]>
Date: Tue, 05 Jul 2011 15:39:56 -0400

> Please find attached a patch which adds a mention of ALTER and USER MAPPING.

Applied with some editorial adjustments.

			regards, tom lane