Hello

> The brackets look rather useless to me, wouldn't it be better to remove
> them? By doing so the longest message becomes:
> "automatic aggressive vacuum to prevent wraparound of table blah.blah"
Hmm,

> 2018-09-13 11:48:09.303 MSK 6994 @ from  [vxid:6/713 txid:0] [] LOG:  
> automatic aggressive vacuum (to prevent wraparound) of table 
> "template0.pg_toast.pg_toast_12252": index scans: 0
or
> 2018-09-13 11:54:55.095 MSK 10115 @ from  [vxid:3/100278 txid:0] [] LOG:  
> automatic aggressive vacuum to prevent wraparound of table 
> "template0.pg_toast.pg_toast_12252": index scans: 0

Looks better for me. Updated patch attached.

regards, Sergei
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index 5649a70..8996d36 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -374,10 +374,20 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
 			 * emitting individual parts of the message when not applicable.
 			 */
 			initStringInfo(&buf);
-			if (aggressive)
-				msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n");
+			if (params->is_wraparound)
+			{
+				if (aggressive)
+					msgfmt = _("automatic aggressive vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");
+				else
+					msgfmt = _("automatic vacuum to prevent wraparound of table \"%s.%s.%s\": index scans: %d\n");
+			}
 			else
-				msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n");
+			{
+				if (aggressive)
+					msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n");
+				else
+					msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n");
+			}
 			appendStringInfo(&buf, msgfmt,
 							 get_database_name(MyDatabaseId),
 							 get_namespace_name(RelationGetNamespace(onerel)),

Reply via email to