aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/createlang.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2014-02-10 21:47:19 -0500
committerPeter Eisentraut <peter_e@gmx.net>2014-02-10 21:47:19 -0500
commitd3c4c471553265e7517be24bae64b81967f6df40 (patch)
treeaef40f43ee9832949a08ae7085b89e26ea5b85ad /src/bin/scripts/createlang.c
parent2895415205d86cc7ab55acab5f90fd70a7c68f3c (diff)
downloadpostgresql-d3c4c471553265e7517be24bae64b81967f6df40.tar.gz
postgresql-d3c4c471553265e7517be24bae64b81967f6df40.zip
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>
Diffstat (limited to 'src/bin/scripts/createlang.c')
-rw-r--r--src/bin/scripts/createlang.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/scripts/createlang.c b/src/bin/scripts/createlang.c
index 7737cb8b26b..9bbd67de7bd 100644
--- a/src/bin/scripts/createlang.c
+++ b/src/bin/scripts/createlang.c
@@ -207,12 +207,12 @@ main(int argc, char *argv[])
* older server, and it's easy enough to continue supporting the old way.
*/
if (PQserverVersion(conn) >= 90100)
- printfPQExpBuffer(&sql, "CREATE EXTENSION \"%s\";\n", langname);
+ printfPQExpBuffer(&sql, "CREATE EXTENSION \"%s\";", langname);
else
- printfPQExpBuffer(&sql, "CREATE LANGUAGE \"%s\";\n", langname);
+ printfPQExpBuffer(&sql, "CREATE LANGUAGE \"%s\";", langname);
if (echo)
- printf("%s", sql.data);
+ printf("%s\n", sql.data);
result = PQexec(conn, sql.data);
if (PQresultStatus(result) != PGRES_COMMAND_OK)
{