mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
scripts: Remove newlines from end of generated SQL
This results in spurious empty lines in the server log. Instead, add the newlines only when printing out the --echo output. In some cases, this was already done, leading to two newlines being printed. Clean that up as well. From: Fabrízio de Royes Mello <fabriziomello@gmail.com>
This commit is contained in:
@@ -253,7 +253,7 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
|
||||
appendPQExpBuffer(&sql, " INDEX %s", name);
|
||||
else if (strcmp(type, "DATABASE") == 0)
|
||||
appendPQExpBuffer(&sql, " DATABASE %s", fmtId(name));
|
||||
appendPQExpBufferStr(&sql, ";\n");
|
||||
appendPQExpBufferStr(&sql, ";");
|
||||
|
||||
conn = connectDatabase(dbname, host, port, username, prompt_password,
|
||||
progname, false);
|
||||
@@ -320,7 +320,7 @@ reindex_system_catalogs(const char *dbname, const char *host, const char *port,
|
||||
|
||||
initPQExpBuffer(&sql);
|
||||
|
||||
appendPQExpBuffer(&sql, "REINDEX SYSTEM %s;\n", dbname);
|
||||
appendPQExpBuffer(&sql, "REINDEX SYSTEM %s;", dbname);
|
||||
|
||||
conn = connectDatabase(dbname, host, port, username, prompt_password,
|
||||
progname, false);
|
||||
|
Reference in New Issue
Block a user