Language fixes for docs related to opclass options

Discussion: https://postgr.es/m/20200620232145.GB17995%40telsasoft.com
Author: Justin Pryzby
Backpatch-through: 13
This commit is contained in:
Alexander Korotkov 2020-06-21 04:48:03 +03:00
parent f7e4989d1c
commit 70004a2a0c
6 changed files with 41 additions and 41 deletions

View File

@ -562,7 +562,7 @@ typedef struct BrinOpcInfo
</varlistentry> </varlistentry>
</variablelist> </variablelist>
Optionally, an operator class for <acronym>BRIN</acronym> can supply the An operator class for <acronym>BRIN</acronym> can optionally specify the
following method: following method:
<variablelist> <variablelist>
@ -570,22 +570,22 @@ typedef struct BrinOpcInfo
<term><function>void options(local_relopts *relopts)</function></term> <term><function>void options(local_relopts *relopts)</function></term>
<listitem> <listitem>
<para> <para>
Defines set of user-visible parameters that control operator class Defines a set of user-visible parameters that control operator class
behavior. behavior.
</para> </para>
<para> <para>
The <function>options</function> function has given pointer to The <function>options</function> function is passed a pointer to a
<replaceable>local_relopts</replaceable> struct, which needs to be <replaceable>local_relopts</replaceable> struct, which needs to be
filled with a set of operator class specific options. The options filled with a set of operator class specific options. The options
can be accessed from other support functions using can be accessed from other support functions using the
<literal>PG_HAS_OPCLASS_OPTIONS()</literal> and <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and
<literal>PG_GET_OPCLASS_OPTIONS()</literal> macros. <literal>PG_GET_OPCLASS_OPTIONS()</literal> macros.
</para> </para>
<para> <para>
Since both key extraction for indexed value and representation of the Since both key extraction of indexed values and representation of the
key in <acronym>GIN</acronym> are flexible, it may depends on key in <acronym>GIN</acronym> are flexible, they may depend on
user-specified parameters. user-specified parameters.
</para> </para>
</listitem> </listitem>

View File

@ -557,7 +557,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
Optionally, a B-tree operator family may provide Optionally, a B-tree operator family may provide
<function>options</function> (<quote>operator class specific <function>options</function> (<quote>operator class specific
options</quote>) support functions, registered under support options</quote>) support functions, registered under support
function number 5. These functions define set of user-visible function number 5. These functions define a set of user-visible
parameters that control operator class behavior. parameters that control operator class behavior.
</para> </para>
<para> <para>
@ -566,19 +566,19 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
<synopsis> <synopsis>
options(<replaceable>relopts</replaceable> <type>local_relopts *</type>) returns void options(<replaceable>relopts</replaceable> <type>local_relopts *</type>) returns void
</synopsis> </synopsis>
The function has given pointer to <replaceable>local_relopts</replaceable> The function is passed a pointer to a <replaceable>local_relopts</replaceable>
struct, which needs to be filled with a set of operator class struct, which needs to be filled with a set of operator class
specific options. The options can be accessed from other support specific options. The options can be accessed from other support
functions using <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and functions using the <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and
<literal>PG_GET_OPCLASS_OPTIONS()</literal> macros. <literal>PG_GET_OPCLASS_OPTIONS()</literal> macros.
</para> </para>
<para> <para>
Currently, no B-Tree operator class has <function>options</function> Currently, no B-Tree operator class has an <function>options</function>
support function. B-tree doesn't allow flexible representation of keys support function. B-tree doesn't allow flexible representation of keys
like GiST, SP-GiST, GIN and BRIN do. So, <function>options</function> like GiST, SP-GiST, GIN and BRIN do. So, <function>options</function>
probably doesn't have much usage in current shape of B-tree index probably doesn't have much application in the current B-tree index
access method. Nevertheless, this support function was added to B-tree access method. Nevertheless, this support function was added to B-tree
for uniformity, and probably it will found its usage during further for uniformity, and will probably find uses during further
evolution of B-tree in <productname>PostgreSQL</productname>. evolution of B-tree in <productname>PostgreSQL</productname>.
</para> </para>
</listitem> </listitem>

View File

@ -411,17 +411,17 @@
</para> </para>
<para> <para>
The <function>options</function> function has given pointer to The <function>options</function> function is passed a pointer to a
<replaceable>local_relopts</replaceable> struct, which needs to be <replaceable>local_relopts</replaceable> struct, which needs to be
filled with s set of operator class specific options. The options filled with a set of operator class specific options. The options
can be accessed from other support functions using can be accessed from other support functions using the
<literal>PG_HAS_OPCLASS_OPTIONS()</literal> and <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and
<literal>PG_GET_OPCLASS_OPTIONS()</literal> macros. <literal>PG_GET_OPCLASS_OPTIONS()</literal> macros.
</para> </para>
<para> <para>
Since both key extraction for indexed value and representation of the Since both key extraction of indexed values and representation of the
key in <acronym>GIN</acronym> are flexible, it may depends on key in <acronym>GIN</acronym> are flexible, they may depend on
user-specified parameters. user-specified parameters.
</para> </para>
</listitem> </listitem>

View File

@ -946,7 +946,7 @@ my_fetch(PG_FUNCTION_ARGS)
<term><function>options</function></term> <term><function>options</function></term>
<listitem> <listitem>
<para> <para>
Allows defintion of user-visible parameters that control operator Allows definition of user-visible parameters that control operator
class behavior. class behavior.
</para> </para>
@ -962,16 +962,16 @@ LANGUAGE C STRICT;
</para> </para>
<para> <para>
The function has given pointer to <replaceable>local_relopts</replaceable> The function is passed a pointer to a <replaceable>local_relopts</replaceable>
struct, which needs to be filled with a set of operator class struct, which needs to be filled with a set of operator class
specific options. The options can be accessed from other support specific options. The options can be accessed from other support
functions using <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and functions using the <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and
<literal>PG_GET_OPCLASS_OPTIONS()</literal> macros. <literal>PG_GET_OPCLASS_OPTIONS()</literal> macros.
</para> </para>
<para> <para>
The sample implementation of my_option() and parameters usage An example implementation of my_options() and parameters use
in the another support function are given below: from other support functions are given below:
<programlisting> <programlisting>
typedef enum MyEnumType typedef enum MyEnumType
@ -990,7 +990,7 @@ typedef struct
int str_param; /* string parameter */ int str_param; /* string parameter */
} MyOptionsStruct; } MyOptionsStruct;
/* String representations for enum values */ /* String representation of enum values */
static relopt_enum_elt_def myEnumValues[] = static relopt_enum_elt_def myEnumValues[] =
{ {
{"on", MY_ENUM_ON}, {"on", MY_ENUM_ON},
@ -1002,7 +1002,7 @@ static relopt_enum_elt_def myEnumValues[] =
static char *str_param_default = "default"; static char *str_param_default = "default";
/* /*
* Sample validatior: checks that string is not longer than 8 bytes. * Sample validator: checks that string is not longer than 8 bytes.
*/ */
static void static void
validate_my_string_relopt(const char *value) validate_my_string_relopt(const char *value)
@ -1090,8 +1090,8 @@ my_compress(PG_FUNCTION_ARGS)
<para> <para>
Since the representation of the key in <acronym>GiST</acronym> is Since the representation of the key in <acronym>GiST</acronym> is
flexible, it may depends on user-specified parameters. For instace, flexible, it may depend on user-specified parameters. For instance,
the length of key signature may be such parameter. See the length of key signature may be specified. See
<literal>gtsvector_options()</literal> for example. <literal>gtsvector_options()</literal> for example.
</para> </para>
</listitem> </listitem>

View File

@ -290,13 +290,13 @@
values for the support method, while the second argument is a pointer to a values for the support method, while the second argument is a pointer to a
C struct where output values must be placed. Four of the mandatory methods just C struct where output values must be placed. Four of the mandatory methods just
return <type>void</type>, since all their results appear in the output struct; but return <type>void</type>, since all their results appear in the output struct; but
<function>leaf_consistent</function> additionally returns a <type>boolean</type> result. <function>leaf_consistent</function> returns a <type>boolean</type> result.
The methods must not modify any fields of their input structs. In all The methods must not modify any fields of their input structs. In all
cases, the output struct is initialized to zeroes before calling the cases, the output struct is initialized to zeroes before calling the
user-defined method. The optional sixth method <function>compress</function> user-defined method. The optional sixth method <function>compress</function>
accepts datum to be indexed as the only argument and returns a value suitable accepts a <type>datum</type> to be indexed as the only argument and returns a value suitable
for physical storage in a leaf tuple. The optional seventh method for physical storage in a leaf tuple. The optional seventh method
<function>options</function> accepts internal pointer to a C struct, where <function>options</function> accepts an <type>internal</type> pointer to a C struct, where
opclass-specific parameters should be placed, and returns <type>void</type>. opclass-specific parameters should be placed, and returns <type>void</type>.
</para> </para>
@ -897,16 +897,16 @@ LANGUAGE C STRICT;
</para> </para>
<para> <para>
The function has given pointer to <replaceable>local_relopts</replaceable> The function is passed a pointer to a <replaceable>local_relopts</replaceable>
struct, which needs to be filled with a set of operator class struct, which needs to be filled with a set of operator class
specific options. The options can be accessed from other support specific options. The options can be accessed from other support
functions using <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and functions using the <literal>PG_HAS_OPCLASS_OPTIONS()</literal> and
<literal>PG_GET_OPCLASS_OPTIONS()</literal> macros. <literal>PG_GET_OPCLASS_OPTIONS()</literal> macros.
</para> </para>
<para> <para>
Since the representation of the key in <acronym>SP-GiST</acronym> is Since the representation of the key in <acronym>SP-GiST</acronym> is
flexible, it may depends on user-specified parameters. flexible, it may depend on user-specified parameters.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -410,9 +410,9 @@
</para> </para>
<para> <para>
Additionally, some opclasses allow user to set specific parameters, which Additionally, some opclasses allow users to specify parameters which
controls its behavior. Each builtin index access method have optional control their behavior. Each builtin index access method has an optional
<function>options</function> support function, which defines set of <function>options</function> support function, which defines a set of
opclass-specific parameters. opclass-specific parameters.
</para> </para>
@ -459,7 +459,7 @@
</row> </row>
<row> <row>
<entry> <entry>
Defines set of options that are specific for this operator class Defines a set of options that are specific to this operator class
(optional) (optional)
</entry> </entry>
<entry>5</entry> <entry>5</entry>
@ -501,7 +501,7 @@
</row> </row>
<row> <row>
<entry> <entry>
Defines set of options that are specific for this operator class Defines a set of options that are specific to this operator class
(optional) (optional)
</entry> </entry>
<entry>3</entry> <entry>3</entry>
@ -584,7 +584,7 @@
<row> <row>
<entry><function>options</function></entry> <entry><function>options</function></entry>
<entry> <entry>
Defines set of options that are specific for this operator class Defines a set of options that are specific to this operator class
(optional) (optional)
</entry> </entry>
<entry>10</entry> <entry>10</entry>
@ -643,7 +643,7 @@
<row> <row>
<entry><function>options</function></entry> <entry><function>options</function></entry>
<entry> <entry>
Defines set of options that are specific for this operator class Defines a set of options that are specific to this operator class
(optional) (optional)
</entry> </entry>
<entry>6</entry> <entry>6</entry>
@ -720,7 +720,7 @@
<row> <row>
<entry><function>options</function></entry> <entry><function>options</function></entry>
<entry> <entry>
Defines set of options that are specific for this operator class Defines a set of options that are specific to this operator class
(optional) (optional)
</entry> </entry>
<entry>7</entry> <entry>7</entry>
@ -778,7 +778,7 @@
<row> <row>
<entry><function>options</function></entry> <entry><function>options</function></entry>
<entry> <entry>
Defines set of options that are specific for this operator class Defines a set of options that are specific to this operator class
(optional) (optional)
</entry> </entry>
<entry>5</entry> <entry>5</entry>