add types to index storage params on doc

Started by Atsushi Torikoshialmost 6 years ago7 messages
#1Atsushi Torikoshi
atorik@gmail.com
1 attachment(s)

Attachments:

add_type_in_createindex_storage-params_v1.patchapplication/x-patch; name=add_type_in_createindex_storage-params_v1.patchDownload
diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml
index 71f2bdb..c0653dd 100644
--- a/doc/src/sgml/ref/create_index.sgml
+++ b/doc/src/sgml/ref/create_index.sgml
@@ -369,7 +369,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-fillfactor" xreflabel="fillfactor">
-    <term><literal>fillfactor</literal>
+    <term><literal>fillfactor</literal> (<type>integer</type>)
      <indexterm>
       <primary><varname>fillfactor</varname> storage parameter</primary>
      </indexterm>
@@ -400,7 +400,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-deduplication" xreflabel="deduplicate_items">
-    <term><literal>deduplicate_items</literal>
+    <term><literal>deduplicate_items</literal> (<type>boolean</type>)
      <indexterm>
       <primary><varname>deduplicate_items</varname> storage parameter</primary>
      </indexterm>
@@ -428,7 +428,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
    </varlistentry>
 
    <varlistentry id="index-reloption-vacuum-cleanup-index-scale-factor" xreflabel="vacuum_cleanup_index_scale_factor">
-    <term><literal>vacuum_cleanup_index_scale_factor</literal>
+    <term><literal>vacuum_cleanup_index_scale_factor</literal> (<type>floating point</type>)
      <indexterm>
       <primary><varname>vacuum_cleanup_index_scale_factor</varname></primary>
       <secondary>storage parameter</secondary>
@@ -448,7 +448,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-buffering" xreflabel="buffering">
-    <term><literal>buffering</literal>
+    <term><literal>buffering</literal> (<type>string</type>)
      <indexterm>
       <primary><varname>buffering</varname> storage parameter</primary>
      </indexterm>
@@ -471,7 +471,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-fastupdate" xreflabel="fastupdate">
-    <term><literal>fastupdate</literal>
+    <term><literal>fastupdate</literal> (<type>boolean</type>)
      <indexterm>
       <primary><varname>fastupdate</varname> storage parameter</primary>
      </indexterm>
@@ -499,7 +499,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-gin-pending-list-limit" xreflabel="gin_pending_list_limit">
-    <term><literal>gin_pending_list_limit</literal>
+    <term><literal>gin_pending_list_limit</literal> (<type>integer</type>)
      <indexterm>
       <primary><varname>gin_pending_list_limit</varname></primary>
       <secondary>storage parameter</secondary>
@@ -520,7 +520,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-pages-per-range" xreflabel="pages_per_range">
-    <term><literal>pages_per_range</literal>
+    <term><literal>pages_per_range</literal> (<type>integer</type>)
      <indexterm>
       <primary><varname>pages_per_range</varname> storage parameter</primary>
      </indexterm>
@@ -535,7 +535,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
    </varlistentry>
 
    <varlistentry id="index-reloption-autosummarize" xreflabel="autosummarize">
-    <term><literal>autosummarize</literal>
+    <term><literal>autosummarize</literal> (<type>boolean</type>)
      <indexterm>
       <primary><varname>autosummarize</varname> storage parameter</primary>
      </indexterm>
#2Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Atsushi Torikoshi (#1)
Re: add types to index storage params on doc

On 2020/03/16 11:09, Atsushi Torikoshi wrote:

Hi,

The current manual on CREATE TABLE[1] describes storage
parameters with their types.
But manual on CREATE INDEX[2] describes storage parameters
WITHOUT their types.

I think it'll be better to add types to storage parameters
on CREATE INDEX for the consistency.

Attached a patch.
Any thought?

Thanks for the patch! It basically looks good to me.

-    <term><literal>buffering</literal>
+    <term><literal>buffering</literal> (<type>string</type>)

Isn't it better to use "enum" rather than "string"?
In the docs about enum GUC parameters, "enum" is used there.

Regards,

--
Fujii Masao
NTT DATA CORPORATION
Advanced Platform Technology Group
Research and Development Headquarters

In reply to: Atsushi Torikoshi (#1)
Re: add types to index storage params on doc

On Sun, Mar 15, 2020 at 7:10 PM Atsushi Torikoshi <atorik@gmail.com> wrote:

I think it'll be better to add types to storage parameters
on CREATE INDEX for the consistency.

Seems reasonable to me.

--
Peter Geoghegan

#4Atsushi Torikoshi
atorik@gmail.com
In reply to: Fujii Masao (#2)
1 attachment(s)
Re: add types to index storage params on doc

Thanks for your comments!

On Mon, Mar 16, 2020 at 11:49 AM Fujii Masao <masao.fujii@oss.nttdata.com>
wrote:

-    <term><literal>buffering</literal>
+    <term><literal>buffering</literal> (<type>string</type>)

Isn't it better to use "enum" rather than "string"?
In the docs about enum GUC parameters, "enum" is used there.

Agreed. I've fixed it to "enum".

But I'm now wondering about the type of check_option[3]https://www.postgresql.org/docs/devel/sql-alterview.html#id-1.9.3.45.6, [4]https://www.postgresql.org/docs/devel/sql-createview.html#id-1.9.3.97.6.
Because I decide the type to "string" referring to check_option, which is
the other element of enumRelOpts in reloptions.c.

Should I also change it to "enum"?

[3]: https://www.postgresql.org/docs/devel/sql-alterview.html#id-1.9.3.45.6
[4]: https://www.postgresql.org/docs/devel/sql-createview.html#id-1.9.3.97.6

Regards,
--
Torikoshi Atsushi

Attachments:

add_type_in_createindex_storage-params_v2.patchapplication/octet-stream; name=add_type_in_createindex_storage-params_v2.patchDownload
diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml
index 71f2bdb..05bda6f 100644
--- a/doc/src/sgml/ref/create_index.sgml
+++ b/doc/src/sgml/ref/create_index.sgml
@@ -369,7 +369,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-fillfactor" xreflabel="fillfactor">
-    <term><literal>fillfactor</literal>
+    <term><literal>fillfactor</literal> (<type>integer</type>)
      <indexterm>
       <primary><varname>fillfactor</varname> storage parameter</primary>
      </indexterm>
@@ -400,7 +400,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-deduplication" xreflabel="deduplicate_items">
-    <term><literal>deduplicate_items</literal>
+    <term><literal>deduplicate_items</literal> (<type>boolean</type>)
      <indexterm>
       <primary><varname>deduplicate_items</varname> storage parameter</primary>
      </indexterm>
@@ -428,7 +428,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
    </varlistentry>
 
    <varlistentry id="index-reloption-vacuum-cleanup-index-scale-factor" xreflabel="vacuum_cleanup_index_scale_factor">
-    <term><literal>vacuum_cleanup_index_scale_factor</literal>
+    <term><literal>vacuum_cleanup_index_scale_factor</literal> (<type>floating point</type>)
      <indexterm>
       <primary><varname>vacuum_cleanup_index_scale_factor</varname></primary>
       <secondary>storage parameter</secondary>
@@ -448,7 +448,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-buffering" xreflabel="buffering">
-    <term><literal>buffering</literal>
+    <term><literal>buffering</literal> (<type>enum</type>)
      <indexterm>
       <primary><varname>buffering</varname> storage parameter</primary>
      </indexterm>
@@ -471,7 +471,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-fastupdate" xreflabel="fastupdate">
-    <term><literal>fastupdate</literal>
+    <term><literal>fastupdate</literal> (<type>boolean</type>)
      <indexterm>
       <primary><varname>fastupdate</varname> storage parameter</primary>
      </indexterm>
@@ -499,7 +499,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-gin-pending-list-limit" xreflabel="gin_pending_list_limit">
-    <term><literal>gin_pending_list_limit</literal>
+    <term><literal>gin_pending_list_limit</literal> (<type>integer</type>)
      <indexterm>
       <primary><varname>gin_pending_list_limit</varname></primary>
       <secondary>storage parameter</secondary>
@@ -520,7 +520,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
 
    <variablelist>
    <varlistentry id="index-reloption-pages-per-range" xreflabel="pages_per_range">
-    <term><literal>pages_per_range</literal>
+    <term><literal>pages_per_range</literal> (<type>integer</type>)
      <indexterm>
       <primary><varname>pages_per_range</varname> storage parameter</primary>
      </indexterm>
@@ -535,7 +535,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
    </varlistentry>
 
    <varlistentry id="index-reloption-autosummarize" xreflabel="autosummarize">
-    <term><literal>autosummarize</literal>
+    <term><literal>autosummarize</literal> (<type>boolean</type>)
      <indexterm>
       <primary><varname>autosummarize</varname> storage parameter</primary>
      </indexterm>
#5Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Atsushi Torikoshi (#4)
Re: add types to index storage params on doc

On 2020-Mar-16, Atsushi Torikoshi wrote:

Thanks for your comments!

On Mon, Mar 16, 2020 at 11:49 AM Fujii Masao <masao.fujii@oss.nttdata.com>
wrote:

-    <term><literal>buffering</literal>
+    <term><literal>buffering</literal> (<type>string</type>)

Isn't it better to use "enum" rather than "string"?
In the docs about enum GUC parameters, "enum" is used there.

Agreed. I've fixed it to "enum".

But I'm now wondering about the type of check_option[3], [4].
Because I decide the type to "string" referring to check_option, which is
the other element of enumRelOpts in reloptions.c.

Should I also change it to "enum"?

Yeah, these were strings until recently (commit 773df883e8f7 Sept 2019).

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#6Atsushi Torikoshi
atorik@gmail.com
In reply to: Alvaro Herrera (#5)
1 attachment(s)
Re: add types to index storage params on doc

On Mon, Mar 16, 2020 at 11:32 PM Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Should I also change it to "enum"?

Yeah, these were strings until recently (commit 773df883e8f7 Sept 2019).

Thanks!

Attached a patch for manuals on create and alter view.

check_option is also described in information_schema.sgml
and its type is 'character_data', but as far as I read
information_schema.sql this is correct and it seems no
need for modification here.

Regards,
--
Torikoshi Atsushi

Attachments:

fix_type_of_check-option_v1.patchapplication/octet-stream; name=fix_type_of_check-option_v1.patchDownload
diff --git a/doc/src/sgml/ref/alter_view.sgml b/doc/src/sgml/ref/alter_view.sgml
index b66160b..4f35061 100644
--- a/doc/src/sgml/ref/alter_view.sgml
+++ b/doc/src/sgml/ref/alter_view.sgml
@@ -143,7 +143,7 @@ ALTER VIEW [ IF EXISTS ] <replaceable class="parameter">name</replaceable> RESET
       Sets or resets a view option.  Currently supported options are:
       <variablelist>
        <varlistentry>
-        <term><literal>check_option</literal> (<type>string</type>)</term>
+        <term><literal>check_option</literal> (<type>enum</type>)</term>
         <listitem>
          <para>
           Changes the check option of the view.  The value must
diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml
index 0abb8fd..bad5a4e 100644
--- a/doc/src/sgml/ref/create_view.sgml
+++ b/doc/src/sgml/ref/create_view.sgml
@@ -131,7 +131,7 @@ CREATE VIEW [ <replaceable>schema</replaceable> . ] <replaceable>view_name</repl
 
       <variablelist>
        <varlistentry>
-        <term><literal>check_option</literal> (<type>string</type>)</term>
+        <term><literal>check_option</literal> (<type>enum</type>)</term>
         <listitem>
          <para>
           This parameter may be either <literal>local</literal> or
#7Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Atsushi Torikoshi (#6)
Re: add types to index storage params on doc

On 2020/03/17 14:52, Atsushi Torikoshi wrote:

On Mon, Mar 16, 2020 at 11:32 PM Alvaro Herrera <alvherre@2ndquadrant.com <mailto:alvherre@2ndquadrant.com>> wrote:

Should I also change it to "enum"?

Yeah, these were strings until recently (commit 773df883e8f7 Sept 2019).

Thanks!

Attached a patch for manuals on create and alter view.

check_option is also described in information_schema.sgml
and its type is 'character_data', but as far as I read
information_schema.sql this is correct and it seems no
need for modification here.

Thanks for the patch!
I pushed two patches that you posted in this thread. Thanks!

Regards,

--
Fujii Masao
NTT DATA CORPORATION
Advanced Platform Technology Group
Research and Development Headquarters