Extraneous newlines in logfile from vacuumdb

Started by Tim Landscheidtabout 16 years ago2 messages
#1Tim Landscheidt
tim@tim-landscheidt.de
1 attachment(s)

Hi,

log file entries from running vacuumdb are "double-spaced",
as vacuumdb ends the commands with ";\n" (cf. attached mini-
patch). Is there a deeper meaning in that, or could it be
trimmed?

TIA,
Tim

Attachments:

vacuumdb.patchtext/x-patchDownload
Index: vacuumdb.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/scripts/vacuumdb.c,v
retrieving revision 1.27
diff -u -r1.27 vacuumdb.c
--- vacuumdb.c	16 Oct 2009 10:38:25 -0000	1.27
+++ vacuumdb.c	24 Oct 2009 17:45:02 -0000
@@ -203,7 +203,7 @@
 		appendPQExpBuffer(&sql, " ANALYZE");
 	if (table)
 		appendPQExpBuffer(&sql, " %s", table);
-	appendPQExpBuffer(&sql, ";\n");
+	appendPQExpBuffer(&sql, ";");
 
 	conn = connectDatabase(dbname, host, port, username, prompt_password, progname);
 	if (!executeMaintenanceCommand(conn, sql.data, echo))
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tim Landscheidt (#1)
Re: Extraneous newlines in logfile from vacuumdb

Tim Landscheidt <tim@tim-landscheidt.de> writes:

log file entries from running vacuumdb are "double-spaced",
as vacuumdb ends the commands with ";\n" (cf. attached mini-
patch). Is there a deeper meaning in that, or could it be
trimmed?

There are a LOT of clients that tend to send queries with trailing
newlines; I'm pretty sure that both pg_dump and psql have instances of
that, for example. If we were to do something about this, which I'm
entirely unconvinced we should, it'd be better to strip trailing
whitespace from the logged query inside the backend.

regards, tom lane