doc patch: note AttributeRelationId passed to FDW validator function

Started by Ian Lawrence Barwickover 2 years ago4 messages
#1Ian Lawrence Barwick
barwick@gmail.com
2 attachment(s)

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

Attachments:

doc-fdw-validator-AttributeRelationId.v2.patchtext/x-patch; charset=US-ASCII; name=doc-fdw-validator-AttributeRelationId.v2.patchDownload
commit 8a9a0c6e087c9a83beb7e1af0d7dcb7f494eed36
Author: Ian Barwick <barwick@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>
doc-fdw-validator-AttributeRelationId.v1.patchtext/x-patch; charset=US-ASCII; name=doc-fdw-validator-AttributeRelationId.v1.patchDownload
commit 4a789bb5d5f9b9cd87a5d9b3569e13c2ebc95f0d
Author: Ian Barwick <barwick@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>
#2Ian Lawrence Barwick
barwick@gmail.com
In reply to: Ian Lawrence Barwick (#1)
Re: doc patch: note AttributeRelationId passed to FDW validator function

2023年6月7日(水) 9:08 Ian Lawrence Barwick <barwick@gmail.com>:

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.

Forgot to add this to a CF; done: https://commitfest.postgresql.org/46/4730/

Regards

Ian Barwick

#3Michael Paquier
michael@paquier.xyz
In reply to: Ian Lawrence Barwick (#2)
Re: doc patch: note AttributeRelationId passed to FDW validator function

On Thu, Dec 28, 2023 at 01:55:27PM +0900, Ian Lawrence Barwick wrote:

2023年6月7日(水) 9:08 Ian Lawrence Barwick <barwick@gmail.com>:

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.

Forgot to add this to a CF; done: https://commitfest.postgresql.org/46/4730/

Agreed that a list is cleaner. Looking around I can see that the
catalogs going through the validator functions are limited to the five
you are listing in your patch. Will apply in a bit, thanks!
--
Michael

#4Ian Lawrence Barwick
barwick@gmail.com
In reply to: Michael Paquier (#3)
Re: doc patch: note AttributeRelationId passed to FDW validator function

2023年12月28日(木) 15:37 Michael Paquier <michael@paquier.xyz>:

On Thu, Dec 28, 2023 at 01:55:27PM +0900, Ian Lawrence Barwick wrote:

2023年6月7日(水) 9:08 Ian Lawrence Barwick <barwick@gmail.com>:

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.

Forgot to add this to a CF; done: https://commitfest.postgresql.org/46/4730/

Agreed that a list is cleaner. Looking around I can see that the
catalogs going through the validator functions are limited to the five
you are listing in your patch. Will apply in a bit, thanks!

Thanks for taking care of that!

Regards

Ian Barwick