public inbox for [email protected]  
help / color / mirror / Atom feed
Improve FDW document (for 9.1)
2+ messages / 2 participants
[nested] [flat]

* Improve FDW document (for 9.1)
@ 2011-06-30 10:32 Shigeru Hanada <[email protected]>
  2011-07-05 19:39 ` Re: Improve FDW document (for 9.1) Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Shigeru Hanada @ 2011-06-30 10:32 UTC (permalink / raw)
  To: pgsql-docs

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>


Attachments:

  [text/plain] fdw_doc.patch (1.3K, 2-fdw_doc.patch)
  download | inline diff:
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>


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Improve FDW document (for 9.1)
  2011-06-30 10:32 Improve FDW document (for 9.1) Shigeru Hanada <[email protected]>
@ 2011-07-05 19:39 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-07-05 19:39 UTC (permalink / raw)
  To: Shigeru Hanada <[email protected]>; +Cc: pgsql-docs

Shigeru Hanada <[email protected]> writes:
> 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.

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

Applied with some editorial adjustments.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-07-05 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 10:32 Improve FDW document (for 9.1) Shigeru Hanada <[email protected]>
2011-07-05 19:39 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox