]> granicus.if.org Git - postgresql/commitdiff
Mention ANALYZE boolean options in documentation.
authorFujii Masao <fujii@postgresql.org>
Wed, 22 May 2019 16:18:16 +0000 (01:18 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 22 May 2019 16:18:16 +0000 (01:18 +0900)
Commit 41b54ba78e allowed not only VACUUM but also ANALYZE options
to take a boolean argument. But it forgot to update the documentation
for ANALYZE. This commit adds the descriptions about those ANALYZE
boolean options into the documentation.

This patch also updates tab-completion for ANALYZE boolean options.

Reported-by: Kyotaro Horiguchi
Author: Fujii Masao
Reviewed-by: Masahiko Sawada, Michael Paquier
Discussion: https://postgr.es/m/CAHGQGwHTUt-kuwgiwe8f0AvTnB+ySqJWh95jvmh-qcoKW9YA9g@mail.gmail.com

doc/src/sgml/ref/analyze.sgml
doc/src/sgml/release-12.sgml
src/bin/psql/tab-complete.c

index fea7f4652159773836268e4670a151eadf140400..4e70b513b5ca55ccfdad3c41be8bf5802e0c6a70 100644 (file)
@@ -26,8 +26,8 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
 
 <phrase>where <replaceable class="parameter">option</replaceable> can be one of:</phrase>
 
-    VERBOSE
-    SKIP_LOCKED
+    VERBOSE [ <replaceable class="parameter">boolean</replaceable> ]
+    SKIP_LOCKED [ <replaceable class="parameter">boolean</replaceable> ]
 
 <phrase>and <replaceable class="parameter">table_and_columns</replaceable> is:</phrase>
 
@@ -95,6 +95,20 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
     </listitem>
    </varlistentry>
 
+   <varlistentry>
+    <term><replaceable class="parameter">boolean</replaceable></term>
+    <listitem>
+     <para>
+      Specifies whether the selected option should be turned on or off.
+      You can write <literal>TRUE</literal>, <literal>ON</literal>, or
+      <literal>1</literal> to enable the option, and <literal>FALSE</literal>,
+      <literal>OFF</literal>, or <literal>0</literal> to disable it.  The
+      <replaceable class="parameter">boolean</replaceable> value can also
+      be omitted, in which case <literal>TRUE</literal> is assumed.
+     </para>
+    </listitem>
+   </varlistentry>
+
    <varlistentry>
     <term><replaceable class="parameter">table_name</replaceable></term>
     <listitem>
index d80d89e6a2808b29bbf6ecbf56f596c2db1f8d43..90999410db8248120f2b2454c6a9376546d1554b 100644 (file)
@@ -1983,8 +1983,8 @@ Author: Robert Haas <rhaas@postgresql.org>
 -->
 
       <para>
-       Allow <command>VACUUM</command> to take optional boolean argument
-       specifications (Masahiko Sawada)
+       Allow <command>VACUUM</command> and <command>ANALYZE</command>
+       to take optional boolean argument specifications (Masahiko Sawada)
       </para>
      </listitem>
 
index e4c03de221fc8691db34ec3c341dd3dfdd8ba8f2..d77aa2936dee367c5ed62d3ce5a768a456b20e15 100644 (file)
@@ -2101,6 +2101,8 @@ psql_completion(const char *text, int start, int end)
                 */
                if (ends_with(prev_wd, '(') || ends_with(prev_wd, ','))
                        COMPLETE_WITH("VERBOSE", "SKIP_LOCKED");
+               else if (TailMatches("VERBOSE|SKIP_LOCKED"))
+                       COMPLETE_WITH("ON", "OFF");
        }
        else if (HeadMatches("ANALYZE") && TailMatches("("))
                /* "ANALYZE (" should be caught above, so assume we want columns */