From b0df450e1c5404515c4d88355a3dc2e200d506d0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 19:53:53 -0500
Subject: [PATCH v9 14/15] fix description of stxstattarget = -1 behavior

Previously sent
https://www.postgresql.org/message-id/20200906011231.GB6744@telsasoft.com
---
 doc/src/sgml/catalogs.sgml             | 3 ++-
 doc/src/sgml/ref/alter_statistics.sgml | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 7e99928d0c..de9bacd34f 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -7298,7 +7298,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        of statistics accumulated for this statistics object by
        <xref linkend="sql-analyze"/>.
        A zero value indicates that no statistics should be collected.
-       A negative value says to use the system default statistics target.
+       A negative value says to use the maximum of the statistics targets of
+       the referenced columns, if set, or the system default statistics target.
        Positive values of <structfield>stxstattarget</structfield>
        determine the target number of <quote>most common values</quote>
        to collect.
diff --git a/doc/src/sgml/ref/alter_statistics.sgml b/doc/src/sgml/ref/alter_statistics.sgml
index 112f5d8924..ac3c18e8af 100644
--- a/doc/src/sgml/ref/alter_statistics.sgml
+++ b/doc/src/sgml/ref/alter_statistics.sgml
@@ -101,7 +101,8 @@ ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET STATISTIC
         The statistic-gathering target for this statistics object for subsequent
         <xref linkend="sql-analyze"/> operations.
         The target can be set in the range 0 to 10000; alternatively, set it
-        to -1 to revert to using the system default statistics
+        to -1 to revert to using the maximum statistics target of the
+        referenced column's, if set, or the system default statistics
         target (<xref linkend="guc-default-statistics-target"/>).
         For more information on the use of statistics by the
         <productname>PostgreSQL</productname> query planner, refer to
-- 
2.17.0

