mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user