mirror of
https://github.com/postgres/postgres.git
synced 2025-05-18 17:41:14 +03:00
Do an explicit fflush after writing a progress message with puts.
This ensures stdout is kept in sync with messages on stderr. Per report from Olaf Ferger.
This commit is contained in:
parent
f40aa225bd
commit
8265a1d816
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/scripts/clusterdb.c,v 1.3 2003/08/04 00:43:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/scripts/clusterdb.c,v 1.3.4.1 2004/01/01 19:27:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -14,14 +14,14 @@
|
|||||||
#include "dumputils.h"
|
#include "dumputils.h"
|
||||||
|
|
||||||
|
|
||||||
static
|
static void
|
||||||
void
|
|
||||||
cluster_one_database(const char *dbname, const char *table,
|
cluster_one_database(const char *dbname, const char *table,
|
||||||
const char *host, const char *port, const char *username, bool password,
|
const char *host, const char *port,
|
||||||
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet);
|
const char *progname, bool echo, bool quiet);
|
||||||
static
|
static void
|
||||||
void
|
cluster_all_databases(const char *host, const char *port,
|
||||||
cluster_all_databases(const char *host, const char *port, const char *username, bool password,
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet);
|
const char *progname, bool echo, bool quiet);
|
||||||
|
|
||||||
static void help(const char *progname);
|
static void help(const char *progname);
|
||||||
@ -151,10 +151,10 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static void
|
||||||
void
|
|
||||||
cluster_one_database(const char *dbname, const char *table,
|
cluster_one_database(const char *dbname, const char *table,
|
||||||
const char *host, const char *port, const char *username, bool password,
|
const char *host, const char *port,
|
||||||
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet)
|
const char *progname, bool echo, bool quiet)
|
||||||
{
|
{
|
||||||
PQExpBufferData sql;
|
PQExpBufferData sql;
|
||||||
@ -192,13 +192,16 @@ cluster_one_database(const char *dbname, const char *table,
|
|||||||
termPQExpBuffer(&sql);
|
termPQExpBuffer(&sql);
|
||||||
|
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("CLUSTER");
|
puts("CLUSTER");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static void
|
||||||
void
|
cluster_all_databases(const char *host, const char *port,
|
||||||
cluster_all_databases(const char *host, const char *port, const char *username, bool password,
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet)
|
const char *progname, bool echo, bool quiet)
|
||||||
{
|
{
|
||||||
PGconn *conn;
|
PGconn *conn;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/scripts/createdb.c,v 1.5 2003/08/04 00:43:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/scripts/createdb.c,v 1.5.4.1 2004/01/01 19:27:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -177,7 +177,10 @@ main(int argc, char *argv[])
|
|||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("CREATE DATABASE");
|
puts("CREATE DATABASE");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
if (comment)
|
if (comment)
|
||||||
{
|
{
|
||||||
@ -200,7 +203,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("COMMENT");
|
puts("COMMENT");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.6 2003/08/04 00:43:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.6.4.1 2004/01/01 19:27:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -224,7 +224,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("CREATE USER");
|
puts("CREATE USER");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/scripts/dropdb.c,v 1.6 2003/08/04 00:43:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/scripts/dropdb.c,v 1.6.4.1 2004/01/01 19:27:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -131,7 +131,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("DROP DATABASE");
|
puts("DROP DATABASE");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/scripts/dropuser.c,v 1.5 2003/07/23 08:47:41 petere Exp $
|
* $Header: /cvsroot/pgsql/src/bin/scripts/dropuser.c,v 1.5.4.1 2004/01/01 19:27:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -131,7 +131,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("DROP USER");
|
puts("DROP USER");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/scripts/vacuumdb.c,v 1.3 2003/08/04 00:43:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/scripts/vacuumdb.c,v 1.3.4.1 2004/01/01 19:27:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -14,15 +14,16 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
|
||||||
static
|
static void
|
||||||
void
|
vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
|
||||||
vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, const char *table,
|
const char *table,
|
||||||
const char *host, const char *port, const char *username, bool password,
|
const char *host, const char *port,
|
||||||
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet);
|
const char *progname, bool echo, bool quiet);
|
||||||
static
|
static void
|
||||||
void
|
|
||||||
vacuum_all_databases(bool full, bool verbose, bool analyze,
|
vacuum_all_databases(bool full, bool verbose, bool analyze,
|
||||||
const char *host, const char *port, const char *username, bool password,
|
const char *host, const char *port,
|
||||||
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet);
|
const char *progname, bool echo, bool quiet);
|
||||||
|
|
||||||
static void help(const char *progname);
|
static void help(const char *progname);
|
||||||
@ -168,10 +169,11 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static void
|
||||||
void
|
vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
|
||||||
vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, const char *table,
|
const char *table,
|
||||||
const char *host, const char *port, const char *username, bool password,
|
const char *host, const char *port,
|
||||||
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet)
|
const char *progname, bool echo, bool quiet)
|
||||||
{
|
{
|
||||||
PQExpBufferData sql;
|
PQExpBufferData sql;
|
||||||
@ -215,14 +217,17 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, c
|
|||||||
termPQExpBuffer(&sql);
|
termPQExpBuffer(&sql);
|
||||||
|
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
|
{
|
||||||
puts("VACUUM");
|
puts("VACUUM");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static void
|
||||||
void
|
|
||||||
vacuum_all_databases(bool full, bool verbose, bool analyze,
|
vacuum_all_databases(bool full, bool verbose, bool analyze,
|
||||||
const char *host, const char *port, const char *username, bool password,
|
const char *host, const char *port,
|
||||||
|
const char *username, bool password,
|
||||||
const char *progname, bool echo, bool quiet)
|
const char *progname, bool echo, bool quiet)
|
||||||
{
|
{
|
||||||
PGconn *conn;
|
PGconn *conn;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user