Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3b31528

Browse files
committed
Restructure foreign data wrapper chapter so it has more than one section.
As noted by Laurenz Albe, our SGML tools deal rather oddly with chapters having just one <sect1>. Perhaps the tooling could be fixed, but really the design of this chapter's introduction is pretty bogus anyhow. Split it into a true introduction and a <sect1> about the FDW functions, so that it reads better and dodges the lack-of-a-chapter-TOC problem.
1 parent 76dfcb9 commit 3b31528

File tree

1 file changed

+45
-38
lines changed

1 file changed

+45
-38
lines changed

doc/src/sgml/fdwhandler.sgml

+45-38
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,6 @@
1717
to write a new foreign data wrapper.
1818
</para>
1919

20-
<para>
21-
The FDW author needs to implement a handler function, and optionally
22-
a validator function. Both functions must be written in a compiled
23-
language such as C, using the version-1 interface.
24-
For details on C language calling conventions and dynamic loading,
25-
see <xref linkend="xfunc-c">.
26-
</para>
27-
28-
<para>
29-
The handler function simply returns a struct of function pointers to
30-
callback functions that will be called by the planner and executor.
31-
Most of the effort in writing an FDW is in implementing these callback
32-
functions.
33-
The handler function must be registered with
34-
<productname>PostgreSQL</productname> as taking no arguments and returning
35-
the special pseudo-type <type>fdw_handler</type>.
36-
The callback functions are plain C functions and are not visible or
37-
callable at the SQL level.
38-
</para>
39-
40-
<para>
41-
The validator function is responsible for validating options given in
42-
<command>CREATE</command> and <command>ALTER</command> commands for its
43-
foreign data wrapper, as well as foreign servers, user mappings, and
44-
foreign tables using the wrapper.
45-
The validator function must be registered as taking two arguments, a text
46-
array containing the options to be validated, and an OID representing the
47-
type of object the options are associated with (in the form of the OID
48-
of the system catalog the object would be stored in, either
49-
<literal>ForeignDataWrapperRelationId</>,
50-
<literal>ForeignServerRelationId</>,
51-
<literal>UserMappingRelationId</>,
52-
or <literal>ForeignTableRelationId</>).
53-
If no validator function is supplied, options are not checked at object
54-
creation time or object alteration time.
55-
</para>
56-
5720
<para>
5821
The foreign data wrappers included in the standard distribution are good
5922
references when trying to write your own. Look into the
@@ -71,7 +34,51 @@
7134
</para>
7235
</note>
7336

74-
<sect1 id="fdw-routines">
37+
<sect1 id="fdw-functions">
38+
<title>Foreign Data Wrapper Functions</title>
39+
40+
<para>
41+
The FDW author needs to implement a handler function, and optionally
42+
a validator function. Both functions must be written in a compiled
43+
language such as C, using the version-1 interface.
44+
For details on C language calling conventions and dynamic loading,
45+
see <xref linkend="xfunc-c">.
46+
</para>
47+
48+
<para>
49+
The handler function simply returns a struct of function pointers to
50+
callback functions that will be called by the planner and executor.
51+
Most of the effort in writing an FDW is in implementing these callback
52+
functions.
53+
The handler function must be registered with
54+
<productname>PostgreSQL</productname> as taking no arguments and
55+
returning the special pseudo-type <type>fdw_handler</type>. The
56+
callback functions are plain C functions and are not visible or
57+
callable at the SQL level. The callback functions are described in
58+
<xref linkend="fdw-callbacks">.
59+
</para>
60+
61+
<para>
62+
The validator function is responsible for validating options given in
63+
<command>CREATE</command> and <command>ALTER</command> commands for its
64+
foreign data wrapper, as well as foreign servers, user mappings, and
65+
foreign tables using the wrapper.
66+
The validator function must be registered as taking two arguments, a
67+
text array containing the options to be validated, and an OID
68+
representing the type of object the options are associated with (in
69+
the form of the OID of the system catalog the object would be stored
70+
in, either
71+
<literal>ForeignDataWrapperRelationId</>,
72+
<literal>ForeignServerRelationId</>,
73+
<literal>UserMappingRelationId</>,
74+
or <literal>ForeignTableRelationId</>).
75+
If no validator function is supplied, options are not checked at object
76+
creation time or object alteration time.
77+
</para>
78+
79+
</sect1>
80+
81+
<sect1 id="fdw-callbacks">
7582
<title>Foreign Data Wrapper Callback Routines</title>
7683

7784
<para>

0 commit comments

Comments
 (0)