Hi

Here:

  https://www.postgresql.org/docs/current/fdw-functions.html

the enumeration of OIDs which might be passed as the FDW validator function's
second argument omits "AttributeRelationId" (as passed when altering
a foreign table's column options).

Attached v1 patch adds this to this list of OIDs.

The alternative v2 patch adds this to this list of OIDs, and also
formats it as an
SGML list, which IMHO is easier to read.

Looks like this has been missing since 9.3.


Regards

Ian Barwick
commit 8a9a0c6e087c9a83beb7e1af0d7dcb7f494eed36
Author: Ian Barwick <barw...@gmail.com>
Date:   Wed Jun 7 08:51:29 2023 +0900

    doc: update FDW validator function description

diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index ac1717bc3c..6dc3755dd0 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -67,13 +67,16 @@
      foreign tables using the wrapper.
      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, either
-     <literal>ForeignDataWrapperRelationId</literal>,
-     <literal>ForeignServerRelationId</literal>,
-     <literal>UserMappingRelationId</literal>,
-     or <literal>ForeignTableRelationId</literal>).
+     representing the type of object the options are associated with. The
+     latter corresponds to the OID of the system catalog the object
+     would be stored in, one of:
+     <itemizedlist spacing="compact">
+      <listitem><para><literal>ForeignDataWrapperRelationId</literal></para></listitem>
+      <listitem><para><literal>ForeignServerRelationId</literal></para></listitem>
+      <listitem><para><literal>UserMappingRelationId</literal></para></listitem>
+      <listitem><para><literal>ForeignTableRelationId</literal></para></listitem>
+      <listitem><para><literal>AttributeRelationId</literal></para></listitem>
+     </itemizedlist>
      If no validator function is supplied, options are not checked at object
      creation time or object alteration time.
     </para>
commit 4a789bb5d5f9b9cd87a5d9b3569e13c2ebc95f0d
Author: Ian Barwick <barw...@gmail.com>
Date:   Wed Jun 7 08:12:57 2023 +0900

    doc: note AttributeRelationId for FDW validator function

diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index ac1717bc3c..d33f5c4fc8 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -73,7 +73,8 @@
      <literal>ForeignDataWrapperRelationId</literal>,
      <literal>ForeignServerRelationId</literal>,
      <literal>UserMappingRelationId</literal>,
-     or <literal>ForeignTableRelationId</literal>).
+     <literal>ForeignTableRelationId</literal>,
+     or <literal>AttributeRelationId</literal>).
      If no validator function is supplied, options are not checked at object
      creation time or object alteration time.
     </para>

Reply via email to