]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Use placeholders and not GUC names in error message (autovacuum)
authorMichael Paquier <michael@paquier.xyz>
Tue, 30 Jun 2026 07:16:56 +0000 (16:16 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 30 Jun 2026 07:16:56 +0000 (16:16 +0900)
A placeholder %s is now used instead of the GUC names in the error
string of this routine.  This is going to be useful for a follow-up
patch, where we will be able to reuse the same string, hence reducing
the translation work.

Based on a suggestion by me.

Author: Baji Shaik <baji.pgdev@gmail.com>
Discussion: https://postgr.es/m/ajnhfw84reaXgjfO@paquier.xyz

src/backend/postmaster/autovacuum.c

index e9aaf24c1bec8d7bf2d6a3e6c2ac04bc17687f9c..127bd9e7da3ccd0be97ca9e06fe9d2ca59d13620 100644 (file)
@@ -3632,10 +3632,11 @@ check_av_worker_gucs(void)
        if (autovacuum_worker_slots < autovacuum_max_workers)
                ereport(WARNING,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                errmsg("\"autovacuum_max_workers\" (%d) should be less than or equal to \"autovacuum_worker_slots\" (%d)",
-                                               autovacuum_max_workers, autovacuum_worker_slots),
-                                errdetail("The server will only start up to \"autovacuum_worker_slots\" (%d) autovacuum workers at a given time.",
-                                                  autovacuum_worker_slots)));
+                                errmsg("\"%s\" (%d) should be less than or equal to \"%s\" (%d)",
+                                               "autovacuum_max_workers", autovacuum_max_workers,
+                                               "autovacuum_worker_slots", autovacuum_worker_slots),
+                                errdetail("The server will only start up to \"%s\" (%d) autovacuum workers at a given time.",
+                                                  "autovacuum_worker_slots", autovacuum_worker_slots)));
 }
 
 /*