doc: improve wal_level docs for the 'minimal' level

Reported-by: David G. Johnston

Discussion: https://postgr.es/m/CAKFQuwZ24UcfkoyLLSW3PMGQATomOcw1nuYFRuMev-NoOF+mYw@mail.gmail.com

Author: David G. Johnston

Backpatch-through: 14, partial to 13
This commit is contained in:
Bruce Momjian 2022-08-12 10:30:01 -04:00
parent e2a02a30c4
commit 4d807bbc4b
1 changed files with 14 additions and 12 deletions

View File

@ -2771,9 +2771,10 @@ include_dir 'conf.d'
levels. This parameter can only be set at server start. levels. This parameter can only be set at server start.
</para> </para>
<para> <para>
In <literal>minimal</literal> level, no information is logged for The <literal>minimal</literal> level generates the least WAL
permanent relations for the remainder of a transaction that creates or volume. It logs no row information for permanent relations
rewrites them. This can make operations much faster (see in transactions that create or
rewrite them. This can make operations much faster (see
<xref linkend="populate-pitr"/>). Operations that initiate this <xref linkend="populate-pitr"/>). Operations that initiate this
optimization include: optimization include:
<simplelist> <simplelist>
@ -2785,19 +2786,20 @@ include_dir 'conf.d'
<member><command>REINDEX</command></member> <member><command>REINDEX</command></member>
<member><command>TRUNCATE</command></member> <member><command>TRUNCATE</command></member>
</simplelist> </simplelist>
But minimal WAL does not contain enough information to reconstruct the However, minimal WAL does not contain sufficient information for
data from a base backup and the WAL logs, so <literal>replica</literal> or point-in-time recovery, so <literal>replica</literal> or
higher must be used to enable WAL archiving higher must be used to enable continuous archiving
(<xref linkend="guc-archive-mode"/>) and streaming replication. (<xref linkend="guc-archive-mode"/>) and streaming binary replication.
In fact, the server will not even start in this mode if
<varname>max_wal_senders</varname> is non-zero.
Note that changing <varname>wal_level</varname> to Note that changing <varname>wal_level</varname> to
<literal>minimal</literal> makes any base backups taken before <literal>minimal</literal> makes previous base backups unusable
unavailable for archive recovery and standby server, which may for point-in-time recovery and standby servers.
lead to data loss.
</para> </para>
<para> <para>
In <literal>logical</literal> level, the same information is logged as In <literal>logical</literal> level, the same information is logged as
with <literal>replica</literal>, plus information needed to allow with <literal>replica</literal>, plus information needed to
extracting logical change sets from the WAL. Using a level of extract logical change sets from the WAL. Using a level of
<literal>logical</literal> will increase the WAL volume, particularly if many <literal>logical</literal> will increase the WAL volume, particularly if many
tables are configured for <literal>REPLICA IDENTITY FULL</literal> and tables are configured for <literal>REPLICA IDENTITY FULL</literal> and
many <command>UPDATE</command> and <command>DELETE</command> statements are many <command>UPDATE</command> and <command>DELETE</command> statements are