summaryrefslogtreecommitdiff
path: root/src/bin/scripts/dropuser.c
diff options
context:
space:
mode:
authorPeter Eisentraut2014-02-11 02:47:19 +0000
committerPeter Eisentraut2014-02-11 02:47:19 +0000
commitd3c4c471553265e7517be24bae64b81967f6df40 (patch)
treeaef40f43ee9832949a08ae7085b89e26ea5b85ad /src/bin/scripts/dropuser.c
parent2895415205d86cc7ab55acab5f90fd70a7c68f3c (diff)
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 <[email protected]>
Diffstat (limited to 'src/bin/scripts/dropuser.c')
-rw-r--r--src/bin/scripts/dropuser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/dropuser.c b/src/bin/scripts/dropuser.c
index b4b153bfa10..69a5a493ae3 100644
--- a/src/bin/scripts/dropuser.c
+++ b/src/bin/scripts/dropuser.c
@@ -125,14 +125,14 @@ main(int argc, char *argv[])
}
initPQExpBuffer(&sql);
- appendPQExpBuffer(&sql, "DROP ROLE %s%s;\n",
+ appendPQExpBuffer(&sql, "DROP ROLE %s%s;",
(if_exists ? "IF EXISTS " : ""), fmtId(dropuser));
conn = connectDatabase("postgres", host, port, username, prompt_password,
progname, false);
if (echo)
- printf("%s", sql.data);
+ printf("%s\n", sql.data);
result = PQexec(conn, sql.data);
if (PQresultStatus(result) != PGRES_COMMAND_OK)