1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-24 14:22:24 +03:00

Add macro for customizing an archiving WARNING message.

Presently, if an archive module's check_configured_cb callback
returns false, a generic WARNING message is emitted, which
unfortunately provides no actionable details about the reason why
the module is not configured.  This commit introduces a macro that
archive module authors can use to add a DETAIL line to this WARNING
message.

Co-authored-by: Tung Nguyen
Reviewed-by: Daniel Gustafsson, Álvaro Herrera
Discussion: https://postgr.es/m/4109578306242a7cd5661171647e11b2%40oss.nttdata.com
This commit is contained in:
Nathan Bossart
2024-03-04 15:41:42 -06:00
parent e5bc9454e5
commit 2c29e7fc95
5 changed files with 39 additions and 3 deletions

View File

@ -114,6 +114,18 @@ WARNING: archive_mode enabled, yet archiving is not configured
In the latter case, the server will periodically call this function, and
archiving will proceed only when it returns <literal>true</literal>.
</para>
<note>
<para>
When returning <literal>false</literal>, it may be useful to append some
additional information to the generic warning message. To do that, provide
a message to the <function>arch_module_check_errdetail</function> macro
before returning <literal>false</literal>. Like
<function>errdetail()</function>, this macro accepts a format string
followed by an optional list of arguments. The resulting string will be
emitted as the <literal>DETAIL</literal> line of the warning message.
</para>
</note>
</sect2>
<sect2 id="archive-module-archive">