Add LOG_NEVER error level code.

This logging level means not to emit the log, which is useful for
functions like relation_needs_vacanalyze().  This function accepts
a log level argument but not all callers want it to emit logs.

Suggested-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/3101163.1775676098%40sss.pgh.pa.us
This commit is contained in:
Nathan Bossart 2026-04-09 10:18:15 -05:00
parent 8b6c89e377
commit 60165db6e1
2 changed files with 3 additions and 1 deletions

View file

@ -3676,7 +3676,8 @@ pg_stat_get_autovacuum_scores(PG_FUNCTION_ARGS)
avopts = extract_autovac_opts(tup, RelationGetDescr(rel));
relation_needs_vacanalyze(form->oid, avopts, form,
effective_multixact_freeze_max_age, 0,
effective_multixact_freeze_max_age,
LOG_NEVER,
&dovacuum, &doanalyze, &wraparound,
&scores);
if (avopts)

View file

@ -23,6 +23,7 @@ struct Node;
/* Error level codes */
#define LOG_NEVER 0 /* Never emit this message */
#define DEBUG5 10 /* Debugging messages, in categories of
* decreasing detail. */
#define DEBUG4 11