DOCS - Question about pg_sequences.last_value notes

Started by Peter Smith11 months ago3 messages
#1Peter Smith
smithpb2250@gmail.com
1 attachment(s)

Hi,

I noticed the pg_sequences system-view DOCS page [1]https://www.postgresql.org/docs/devel/view-pg-sequences.html has a note about
the 'last_value' field. But the note is not within the row for that
field. Indeed, it is not even within the table.

Is it deliberate? Apparently, this changed in commit 3cb2f13 [2]https://github.com/postgres/postgres/commit/3cb2f13ac500983c9c6b1eef3b3c2091c26f3040, so
CC-ing author Nathan.

My attached patch just moved the paragraph into the row where I felt
it belonged.

======
[1]: https://www.postgresql.org/docs/devel/view-pg-sequences.html
[2]: https://github.com/postgres/postgres/commit/3cb2f13ac500983c9c6b1eef3b3c2091c26f3040

Kind Regards,
Peter Smith.
Fujitsu Australia

Attachments:

v1-0001-DOCS-pg_sequuences.last_value.patchapplication/octet-stream; name=v1-0001-DOCS-pg_sequuences.last_value.patchDownload
From 243c8e3fd145ed86a119b011316844e7f2f13352 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 13 Feb 2025 15:42:44 +1100
Subject: [PATCH v1] DOCS - pg_sequuences.last_value

---
 doc/src/sgml/system-views.sgml | 45 +++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml
index be81c2b..99352ae 100644
--- a/doc/src/sgml/system-views.sgml
+++ b/doc/src/sgml/system-views.sgml
@@ -3133,35 +3133,34 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
        The last sequence value written to disk.  If caching is used,
        this value can be greater than the last value handed out from the
        sequence.
+      </para>
+      <para>
+       The <structfield>last_value</structfield> column will read as null if any of
+       the following are true:
+       <itemizedlist>
+        <listitem>
+         <para>
+          The sequence has not been read from yet.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          The current user does not have <literal>USAGE</literal> or
+          <literal>SELECT</literal> privilege on the sequence.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          The sequence is unlogged and the server is a standby.
+         </para>
+        </listitem>
+       </itemizedlist>
       </para></entry>
      </row>
     </tbody>
    </tgroup>
   </table>
 
-  <para>
-   The <structfield>last_value</structfield> column will read as null if any of
-   the following are true:
-   <itemizedlist>
-    <listitem>
-     <para>
-      The sequence has not been read from yet.
-     </para>
-    </listitem>
-    <listitem>
-     <para>
-      The current user does not have <literal>USAGE</literal> or
-      <literal>SELECT</literal> privilege on the sequence.
-     </para>
-    </listitem>
-    <listitem>
-     <para>
-      The sequence is unlogged and the server is a standby.
-     </para>
-    </listitem>
-   </itemizedlist>
-  </para>
-
  </sect1>
 
  <sect1 id="view-pg-settings">
-- 
1.8.3.1

#2Nathan Bossart
nathandbossart@gmail.com
In reply to: Peter Smith (#1)
Re: DOCS - Question about pg_sequences.last_value notes

On Thu, Feb 13, 2025 at 03:59:45PM +1100, Peter Smith wrote:

I noticed the pg_sequences system-view DOCS page [1] has a note about
the 'last_value' field. But the note is not within the row for that
field. Indeed, it is not even within the table.

Is it deliberate? Apparently, this changed in commit 3cb2f13 [2], so
CC-ing author Nathan.

Yes, this was intentional. I felt this was too much information to squeeze
into the table, and so I followed the example of pg_user_mappings [0]https://www.postgresql.org/docs/devel/view-pg-user-mappings.html and
placed it below.

[0]: https://www.postgresql.org/docs/devel/view-pg-user-mappings.html

--
nathan

#3Peter Smith
smithpb2250@gmail.com
In reply to: Nathan Bossart (#2)
Re: DOCS - Question about pg_sequences.last_value notes

On Fri, Feb 14, 2025 at 8:35 AM Nathan Bossart <nathandbossart@gmail.com> wrote:

On Thu, Feb 13, 2025 at 03:59:45PM +1100, Peter Smith wrote:

I noticed the pg_sequences system-view DOCS page [1] has a note about
the 'last_value' field. But the note is not within the row for that
field. Indeed, it is not even within the table.

Is it deliberate? Apparently, this changed in commit 3cb2f13 [2], so
CC-ing author Nathan.

Yes, this was intentional. I felt this was too much information to squeeze
into the table, and so I followed the example of pg_user_mappings [0] and
placed it below.

[0] https://www.postgresql.org/docs/devel/view-pg-user-mappings.html

OK. Thanks for the explanation.

======
Kind Regards,
Peter Smith.
Fujitsu Australia