doc: Improve postgres command for shared_memory_size_in_huge_pages
authorMichael Paquier <michael@paquier.xyz>
Thu, 24 Mar 2022 11:56:31 +0000 (20:56 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 24 Mar 2022 11:56:31 +0000 (20:56 +0900)
The command used in the documentation to retrieve the value of the
runtime-computed GUC shared_memory_size_in_huge_pages would also show to
the user all the log messages generated by the postmaster before and
after printing the wanted value.  This can be confusing, as the wanted
result could be masked with a lot of noise.

One way to avoid those log messages is to use something like "-c
log_min_messages=fatal" in the command (my idea, but that's not common
knowledge).  Rather than mentioning this option, suffix the command with
a redirection of stderr to /dev/null, which is the stream location where
the logs show up.  This is enough to show only the GUC value to the
user when copy-pasting the command.

Reported-by: Magnus Hagander
Author: Nathan Bossart
Discussion: https://postgr.es/m/20220314173417.GA1020555@nathanxps13

doc/src/sgml/runtime.sgml

index ffb0b6f287b9059cee8205c3c57ae91dc4e4fcc0..3a463f12d75850acab1803e7b9f6baa41a9af33c 100644 (file)
@@ -1448,7 +1448,7 @@ export PG_OOM_ADJUST_VALUE=0
     server must be shut down to view this runtime-computed parameter.
     This might look like:
 <programlisting>
-$ <userinput>postgres -D $PGDATA -C shared_memory_size_in_huge_pages</userinput>
+$ <userinput>postgres -D $PGDATA -C shared_memory_size_in_huge_pages 2> /dev/null</userinput>
 3170
 $ <userinput>grep ^Hugepagesize /proc/meminfo</userinput>
 Hugepagesize:       2048 kB