appendPQExpBufferStr(&sql, " VERBOSE");
        if (table)
                appendPQExpBuffer(&sql, " %s", table);
-       appendPQExpBufferStr(&sql, ";\n");
+       appendPQExpBufferStr(&sql, ";");
 
        conn = connectDatabase(dbname, host, port, username, prompt_password,
                                                   progname, false);
 
        if (lc_ctype)
                appendPQExpBuffer(&sql, " LC_CTYPE '%s'", lc_ctype);
 
-       appendPQExpBufferStr(&sql, ";\n");
+       appendPQExpBufferStr(&sql, ";");
 
        /* No point in trying to use postgres db when creating postgres db. */
        if (maintenance_db == NULL && strcmp(dbname, "postgres") == 0)
                                                                          prompt_password, progname);
 
        if (echo)
-               printf("%s", sql.data);
+               printf("%s\n", sql.data);
        result = PQexec(conn, sql.data);
 
        if (PQresultStatus(result) != PGRES_COMMAND_OK)
        {
                printfPQExpBuffer(&sql, "COMMENT ON DATABASE %s IS ", fmtId(dbname));
                appendStringLiteralConn(&sql, comment, conn);
-               appendPQExpBufferStr(&sql, ";\n");
+               appendPQExpBufferStr(&sql, ";");
 
                if (echo)
-                       printf("%s", sql.data);
+                       printf("%s\n", sql.data);
                result = PQexec(conn, sql.data);
 
                if (PQresultStatus(result) != PGRES_COMMAND_OK)
 
         * 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)
        {
 
                                appendPQExpBuffer(&sql, "%s", fmtId(cell->val));
                }
        }
-       appendPQExpBufferStr(&sql, ";\n");
+       appendPQExpBufferStr(&sql, ";");
 
        if (echo)
-               printf("%s", sql.data);
+               printf("%s\n", sql.data);
        result = PQexec(conn, sql.data);
 
        if (PQresultStatus(result) != PGRES_COMMAND_OK)
 
 
        initPQExpBuffer(&sql);
 
-       appendPQExpBuffer(&sql, "DROP DATABASE %s%s;\n",
+       appendPQExpBuffer(&sql, "DROP DATABASE %s%s;",
                                          (if_exists ? "IF EXISTS " : ""), fmtId(dbname));
 
        /* Avoid trying to drop postgres db while we are connected to it. */
                                                        host, port, username, prompt_password, progname);
 
        if (echo)
-               printf("%s", sql.data);
+               printf("%s\n", sql.data);
        result = PQexec(conn, sql.data);
        if (PQresultStatus(result) != PGRES_COMMAND_OK)
        {
 
         * Attempt to drop the language.  We do not use CASCADE, so that the drop
         * will fail if there are any functions in the language.
         */
-       printfPQExpBuffer(&sql, "DROP EXTENSION \"%s\";\n", langname);
+       printfPQExpBuffer(&sql, "DROP EXTENSION \"%s\";", langname);
 
        if (echo)
-               printf("%s", sql.data);
+               printf("%s\n", sql.data);
        result = PQexec(conn, sql.data);
        if (PQresultStatus(result) != PGRES_COMMAND_OK)
        {
 
        }
 
        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)
 
                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);
 
        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);
 
        }
        if (table)
                appendPQExpBuffer(&sql, " %s", table);
-       appendPQExpBufferStr(&sql, ";\n");
+       appendPQExpBufferStr(&sql, ";");
 
        if (!executeMaintenanceCommand(conn, sql.data, echo))
        {