Commit 9539e64b authored by Peter Eisentraut's avatar Peter Eisentraut

Remove gratuitous response messages from utility programs.

(Possibly release notes material, lest users be confused.)

The --quiet option is now obsolete and without effect in createdb,
createuser, dropdb, dropuser; kept for compatibility but marked for
removal in 8.4.

Progress messages when acting on all databases now go to stdout instead
of stderr, since they are not in fact errors.

Ordered options in reindexdb reference page alphabetically, like in
other programs' pages.
parent efbd5bcb
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.21 2007/03/26 17:23:36 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.22 2007/06/04 10:02:40 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -102,7 +102,7 @@ PostgreSQL documentation ...@@ -102,7 +102,7 @@ PostgreSQL documentation
<term><option>--quiet</></term> <term><option>--quiet</></term>
<listitem> <listitem>
<para> <para>
Do not display a response. Do not display progress messages.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.44 2007/03/26 17:23:36 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.45 2007/06/04 10:02:40 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -129,16 +129,6 @@ PostgreSQL documentation ...@@ -129,16 +129,6 @@ PostgreSQL documentation
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-q</></term>
<term><option>--quiet</></term>
<listitem>
<para>
Do not display a response.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>-T <replaceable class="parameter">template</replaceable></></term> <term><option>-T <replaceable class="parameter">template</replaceable></></term>
<term><option>--template <replaceable class="parameter">template</replaceable></></term> <term><option>--template <replaceable class="parameter">template</replaceable></></term>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/createuser.sgml,v 1.47 2007/03/26 17:23:36 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/createuser.sgml,v 1.48 2007/06/04 10:02:40 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -242,16 +242,6 @@ PostgreSQL documentation ...@@ -242,16 +242,6 @@ PostgreSQL documentation
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-q</></term>
<term><option>--quiet</></term>
<listitem>
<para>
Do not display a response.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.31 2007/03/26 17:23:36 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.32 2007/06/04 10:02:40 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -85,16 +85,6 @@ PostgreSQL documentation ...@@ -85,16 +85,6 @@ PostgreSQL documentation
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-q</></term>
<term><option>--quiet</></term>
<listitem>
<para>
Do not display a response.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.36 2007/03/26 17:23:36 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.37 2007/06/04 10:02:40 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -87,16 +87,6 @@ PostgreSQL documentation ...@@ -87,16 +87,6 @@ PostgreSQL documentation
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>-q</></term>
<term><option>--quiet</></term>
<listitem>
<para>
Do not display a response.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
......
...@@ -75,21 +75,27 @@ PostgreSQL documentation ...@@ -75,21 +75,27 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-s</></term> <term><option><optional>-d</> <replaceable class="parameter">dbname</replaceable></></term>
<term><option>--system</></term> <term><option><optional>--dbname</> <replaceable class="parameter">dbname</replaceable></></term>
<listitem> <listitem>
<para> <para>
Reindex database's system catalogs. Specifies the name of the database to be reindexed.
If this is not specified and <option>-a</option> (or
<option>--all</option>) is not used, the database name is read
from the environment variable <envar>PGDATABASE</envar>. If
that is not set, the user name specified for the connection is
used.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-t <replaceable class="parameter">table</replaceable></></term> <term><option>-e</></term>
<term><option>--table <replaceable class="parameter">table</replaceable></></term> <term><option>--echo</></term>
<listitem> <listitem>
<para> <para>
Reindex <replaceable class="parameter">table</replaceable> only. Echo the commands that <application>reindexdb</application> generates
and sends to the server.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -105,41 +111,34 @@ PostgreSQL documentation ...@@ -105,41 +111,34 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option><optional>-d</> <replaceable class="parameter">dbname</replaceable></></term> <term><option>-q</></term>
<term><option><optional>--dbname</> <replaceable class="parameter">dbname</replaceable></></term> <term><option>--quiet</></term>
<listitem> <listitem>
<para> <para>
Specifies the name of the database to be reindexed. Do not display progress messages.
If this is not specified and <option>-a</option> (or
<option>--all</option>) is not used, the database name is read
from the environment variable <envar>PGDATABASE</envar>. If
that is not set, the user name specified for the connection is
used.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-e</></term> <term><option>-s</></term>
<term><option>--echo</></term> <term><option>--system</></term>
<listitem> <listitem>
<para> <para>
Echo the commands that <application>reindexdb</application> generates Reindex database's system catalogs.
and sends to the server.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-q</></term> <term><option>-t <replaceable class="parameter">table</replaceable></></term>
<term><option>--quiet</></term> <term><option>--table <replaceable class="parameter">table</replaceable></></term>
<listitem> <listitem>
<para> <para>
Do not display a response. Reindex <replaceable class="parameter">table</replaceable> only.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.40 2007/03/26 17:23:37 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.41 2007/06/04 10:02:40 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -119,7 +119,7 @@ PostgreSQL documentation ...@@ -119,7 +119,7 @@ PostgreSQL documentation
<term><option>--quiet</></term> <term><option>--quiet</></term>
<listitem> <listitem>
<para> <para>
Do not display a response. Do not display progress messages.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Portions Copyright (c) 2002-2007, PostgreSQL Global Development Group * Portions Copyright (c) 2002-2007, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.17 2007/04/09 18:21:22 mha Exp $ * $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.18 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
static void cluster_one_database(const char *dbname, const char *table, static void cluster_one_database(const char *dbname, const char *table,
const char *host, const char *port, 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);
static void cluster_all_databases(const char *host, const char *port, static void 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);
...@@ -145,7 +145,7 @@ main(int argc, char *argv[]) ...@@ -145,7 +145,7 @@ main(int argc, char *argv[])
cluster_one_database(dbname, table, cluster_one_database(dbname, table,
host, port, username, password, host, port, username, password,
progname, echo, quiet); progname, echo);
} }
exit(0); exit(0);
...@@ -156,7 +156,7 @@ static void ...@@ -156,7 +156,7 @@ static 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 *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)
{ {
PQExpBufferData sql; PQExpBufferData sql;
...@@ -183,12 +183,6 @@ cluster_one_database(const char *dbname, const char *table, ...@@ -183,12 +183,6 @@ cluster_one_database(const char *dbname, const char *table,
} }
PQfinish(conn); PQfinish(conn);
termPQExpBuffer(&sql); termPQExpBuffer(&sql);
if (!quiet)
{
puts("CLUSTER");
fflush(stdout);
}
} }
...@@ -210,11 +204,14 @@ cluster_all_databases(const char *host, const char *port, ...@@ -210,11 +204,14 @@ cluster_all_databases(const char *host, const char *port,
char *dbname = PQgetvalue(result, i, 0); char *dbname = PQgetvalue(result, i, 0);
if (!quiet) if (!quiet)
fprintf(stderr, _("%s: clustering database \"%s\"\n"), progname, dbname); {
printf(_("%s: clustering database \"%s\"\n"), progname, dbname);
fflush(stdout);
}
cluster_one_database(dbname, NULL, cluster_one_database(dbname, NULL,
host, port, username, password, host, port, username, password,
progname, echo, quiet); progname, echo);
} }
PQclear(result); PQclear(result);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.22 2007/01/05 22:19:50 momjian Exp $ * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.23 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -48,7 +48,6 @@ main(int argc, char *argv[]) ...@@ -48,7 +48,6 @@ main(int argc, char *argv[])
char *username = NULL; char *username = NULL;
bool password = false; bool password = false;
bool echo = false; bool echo = false;
bool quiet = false;
char *owner = NULL; char *owner = NULL;
char *tablespace = NULL; char *tablespace = NULL;
char *template = NULL; char *template = NULL;
...@@ -84,7 +83,7 @@ main(int argc, char *argv[]) ...@@ -84,7 +83,7 @@ main(int argc, char *argv[])
echo = true; echo = true;
break; break;
case 'q': case 'q':
quiet = true; /* obsolete; remove in 8.4 */
break; break;
case 'O': case 'O':
owner = optarg; owner = optarg;
...@@ -175,12 +174,6 @@ main(int argc, char *argv[]) ...@@ -175,12 +174,6 @@ main(int argc, char *argv[])
PQclear(result); PQclear(result);
PQfinish(conn); PQfinish(conn);
if (!quiet)
{
puts("CREATE DATABASE");
fflush(stdout);
}
if (comment) if (comment)
{ {
conn = connectDatabase(dbname, host, port, username, password, progname); conn = connectDatabase(dbname, host, port, username, password, progname);
...@@ -203,11 +196,6 @@ main(int argc, char *argv[]) ...@@ -203,11 +196,6 @@ main(int argc, char *argv[])
PQclear(result); PQclear(result);
PQfinish(conn); PQfinish(conn);
if (!quiet)
{
puts("COMMENT");
fflush(stdout);
}
} }
exit(0); exit(0);
...@@ -226,7 +214,6 @@ help(const char *progname) ...@@ -226,7 +214,6 @@ help(const char *progname)
printf(_(" -O, --owner=OWNER database user to own the new database\n")); printf(_(" -O, --owner=OWNER database user to own the new database\n"));
printf(_(" -T, --template=TEMPLATE template database to copy\n")); printf(_(" -T, --template=TEMPLATE template database to copy\n"));
printf(_(" -e, --echo show the commands being sent to the server\n")); printf(_(" -e, --echo show the commands being sent to the server\n"));
printf(_(" -q, --quiet don't write any messages\n"));
printf(_(" --help show this help, then exit\n")); printf(_(" --help show this help, then exit\n"));
printf(_(" --version output version information, then exit\n")); printf(_(" --version output version information, then exit\n"));
printf(_("\nConnection options:\n")); printf(_("\nConnection options:\n"));
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.35 2007/01/05 22:19:50 momjian Exp $ * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.36 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -63,7 +63,6 @@ main(int argc, char *argv[]) ...@@ -63,7 +63,6 @@ main(int argc, char *argv[])
char *username = NULL; char *username = NULL;
bool password = false; bool password = false;
bool echo = false; bool echo = false;
bool quiet = false;
char *conn_limit = NULL; char *conn_limit = NULL;
bool pwprompt = false; bool pwprompt = false;
char *newpassword = NULL; char *newpassword = NULL;
...@@ -107,7 +106,7 @@ main(int argc, char *argv[]) ...@@ -107,7 +106,7 @@ main(int argc, char *argv[])
echo = true; echo = true;
break; break;
case 'q': case 'q':
quiet = true; /* obsolete; remove in 8.4 */
break; break;
case 'd': case 'd':
createdb = TRI_YES; createdb = TRI_YES;
...@@ -297,11 +296,6 @@ main(int argc, char *argv[]) ...@@ -297,11 +296,6 @@ main(int argc, char *argv[])
PQclear(result); PQclear(result);
PQfinish(conn); PQfinish(conn);
if (!quiet)
{
puts("CREATE ROLE");
fflush(stdout);
}
exit(0); exit(0);
} }
...@@ -329,7 +323,6 @@ help(const char *progname) ...@@ -329,7 +323,6 @@ help(const char *progname)
printf(_(" -E, --encrypted encrypt stored password\n")); printf(_(" -E, --encrypted encrypt stored password\n"));
printf(_(" -N, --unencrypted do not encrypt stored password\n")); printf(_(" -N, --unencrypted do not encrypt stored password\n"));
printf(_(" -e, --echo show the commands being sent to the server\n")); printf(_(" -e, --echo show the commands being sent to the server\n"));
printf(_(" -q, --quiet don't write any messages\n"));
printf(_(" --help show this help, then exit\n")); printf(_(" --help show this help, then exit\n"));
printf(_(" --version output version information, then exit\n")); printf(_(" --version output version information, then exit\n"));
printf(_("\nConnection options:\n")); printf(_("\nConnection options:\n"));
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.19 2007/01/05 22:19:50 momjian Exp $ * $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.20 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -42,7 +42,6 @@ main(int argc, char *argv[]) ...@@ -42,7 +42,6 @@ main(int argc, char *argv[])
char *username = NULL; char *username = NULL;
bool password = false; bool password = false;
bool echo = false; bool echo = false;
bool quiet = false;
bool interactive = false; bool interactive = false;
PQExpBufferData sql; PQExpBufferData sql;
...@@ -75,7 +74,7 @@ main(int argc, char *argv[]) ...@@ -75,7 +74,7 @@ main(int argc, char *argv[])
echo = true; echo = true;
break; break;
case 'q': case 'q':
quiet = true; /* obsolete; remove in 8.4 */
break; break;
case 'i': case 'i':
interactive = true; interactive = true;
...@@ -130,11 +129,6 @@ main(int argc, char *argv[]) ...@@ -130,11 +129,6 @@ main(int argc, char *argv[])
PQclear(result); PQclear(result);
PQfinish(conn); PQfinish(conn);
if (!quiet)
{
puts("DROP DATABASE");
fflush(stdout);
}
exit(0); exit(0);
} }
...@@ -148,7 +142,6 @@ help(const char *progname) ...@@ -148,7 +142,6 @@ help(const char *progname)
printf(_("\nOptions:\n")); printf(_("\nOptions:\n"));
printf(_(" -e, --echo show the commands being sent to the server\n")); printf(_(" -e, --echo show the commands being sent to the server\n"));
printf(_(" -i, --interactive prompt before deleting anything\n")); printf(_(" -i, --interactive prompt before deleting anything\n"));
printf(_(" -q, --quiet don't write any messages\n"));
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n")); printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
printf(_(" -p, --port=PORT database server port\n")); printf(_(" -p, --port=PORT database server port\n"));
printf(_(" -U, --username=USERNAME user name to connect as\n")); printf(_(" -U, --username=USERNAME user name to connect as\n"));
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.20 2007/01/05 22:19:50 momjian Exp $ * $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.21 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -42,7 +42,6 @@ main(int argc, char *argv[]) ...@@ -42,7 +42,6 @@ main(int argc, char *argv[])
char *username = NULL; char *username = NULL;
bool password = false; bool password = false;
bool echo = false; bool echo = false;
bool quiet = false;
bool interactive = false; bool interactive = false;
PQExpBufferData sql; PQExpBufferData sql;
...@@ -75,7 +74,7 @@ main(int argc, char *argv[]) ...@@ -75,7 +74,7 @@ main(int argc, char *argv[])
echo = true; echo = true;
break; break;
case 'q': case 'q':
quiet = true; /* obsolete; remove in 8.4 */
break; break;
case 'i': case 'i':
interactive = true; interactive = true;
...@@ -129,11 +128,6 @@ main(int argc, char *argv[]) ...@@ -129,11 +128,6 @@ main(int argc, char *argv[])
PQclear(result); PQclear(result);
PQfinish(conn); PQfinish(conn);
if (!quiet)
{
puts("DROP ROLE");
fflush(stdout);
}
exit(0); exit(0);
} }
...@@ -147,7 +141,6 @@ help(const char *progname) ...@@ -147,7 +141,6 @@ help(const char *progname)
printf(_("\nOptions:\n")); printf(_("\nOptions:\n"));
printf(_(" -e, --echo show the commands being sent to the server\n")); printf(_(" -e, --echo show the commands being sent to the server\n"));
printf(_(" -i, --interactive prompt before deleting anything\n")); printf(_(" -i, --interactive prompt before deleting anything\n"));
printf(_(" -q, --quiet don't write any messages\n"));
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n")); printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
printf(_(" -p, --port=PORT database server port\n")); printf(_(" -p, --port=PORT database server port\n"));
printf(_(" -U, --username=USERNAME user name to connect as (not the one to drop)\n")); printf(_(" -U, --username=USERNAME user name to connect as (not the one to drop)\n"));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/scripts/reindexdb.c,v 1.10 2007/04/09 18:21:22 mha Exp $ * $PostgreSQL: pgsql/src/bin/scripts/reindexdb.c,v 1.11 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -18,7 +18,7 @@ static void reindex_one_database(const char *name, const char *dbname, ...@@ -18,7 +18,7 @@ static void reindex_one_database(const char *name, const char *dbname,
const char *type, const char *host, const char *type, const char *host,
const char *port, const char *username, const char *port, const char *username,
bool password, const char *progname, bool password, const char *progname,
bool echo, bool quiet); bool echo);
static void reindex_all_databases(const char *host, const char *port, static void reindex_all_databases(const char *host, const char *port,
const char *username, bool password, const char *username, bool password,
const char *progname, bool echo, const char *progname, bool echo,
...@@ -26,8 +26,7 @@ static void reindex_all_databases(const char *host, const char *port, ...@@ -26,8 +26,7 @@ static void reindex_all_databases(const char *host, const char *port,
static void reindex_system_catalogs(const char *dbname, static void reindex_system_catalogs(const char *dbname,
const char *host, const char *port, const char *host, const char *port,
const char *username, bool password, const char *username, bool password,
const char *progname, bool echo, const char *progname, bool echo);
bool quiet);
static void help(const char *progname); static void help(const char *progname);
int int
...@@ -178,7 +177,7 @@ main(int argc, char *argv[]) ...@@ -178,7 +177,7 @@ main(int argc, char *argv[])
} }
reindex_system_catalogs(dbname, host, port, username, password, reindex_system_catalogs(dbname, host, port, username, password,
progname, echo, quiet); progname, echo);
} }
else else
{ {
...@@ -194,14 +193,14 @@ main(int argc, char *argv[]) ...@@ -194,14 +193,14 @@ main(int argc, char *argv[])
if (index) if (index)
reindex_one_database(index, dbname, "INDEX", host, port, reindex_one_database(index, dbname, "INDEX", host, port,
username, password, progname, echo, quiet); username, password, progname, echo);
if (table) if (table)
reindex_one_database(table, dbname, "TABLE", host, port, reindex_one_database(table, dbname, "TABLE", host, port,
username, password, progname, echo, quiet); username, password, progname, echo);
/* reindex database only if index or table is not specified */ /* reindex database only if index or table is not specified */
if (index == NULL && table == NULL) if (index == NULL && table == NULL)
reindex_one_database(dbname, dbname, "DATABASE", host, port, reindex_one_database(dbname, dbname, "DATABASE", host, port,
username, password, progname, echo, quiet); username, password, progname, echo);
} }
exit(0); exit(0);
...@@ -210,8 +209,7 @@ main(int argc, char *argv[]) ...@@ -210,8 +209,7 @@ main(int argc, char *argv[])
static void static void
reindex_one_database(const char *name, const char *dbname, const char *type, reindex_one_database(const char *name, const char *dbname, const char *type,
const char *host, const char *port, const char *username, const char *host, const char *port, const char *username,
bool password, const char *progname, bool echo, bool password, const char *progname, bool echo)
bool quiet)
{ {
PQExpBufferData sql; PQExpBufferData sql;
...@@ -247,12 +245,6 @@ reindex_one_database(const char *name, const char *dbname, const char *type, ...@@ -247,12 +245,6 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
PQfinish(conn); PQfinish(conn);
termPQExpBuffer(&sql); termPQExpBuffer(&sql);
if (!quiet)
{
puts("REINDEX");
fflush(stdout);
}
} }
static void static void
...@@ -273,10 +265,13 @@ reindex_all_databases(const char *host, const char *port, ...@@ -273,10 +265,13 @@ reindex_all_databases(const char *host, const char *port,
char *dbname = PQgetvalue(result, i, 0); char *dbname = PQgetvalue(result, i, 0);
if (!quiet) if (!quiet)
fprintf(stderr, _("%s: reindexing database \"%s\"\n"), progname, dbname); {
printf(_("%s: reindexing database \"%s\"\n"), progname, dbname);
fflush(stdout);
}
reindex_one_database(dbname, dbname, "DATABASE", host, port, username, reindex_one_database(dbname, dbname, "DATABASE", host, port, username,
password, progname, echo, quiet); password, progname, echo);
} }
PQclear(result); PQclear(result);
...@@ -285,7 +280,7 @@ reindex_all_databases(const char *host, const char *port, ...@@ -285,7 +280,7 @@ reindex_all_databases(const char *host, const char *port,
static void static void
reindex_system_catalogs(const char *dbname, const char *host, const char *port, reindex_system_catalogs(const char *dbname, 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)
{ {
PQExpBufferData sql; PQExpBufferData sql;
...@@ -305,12 +300,6 @@ reindex_system_catalogs(const char *dbname, const char *host, const char *port, ...@@ -305,12 +300,6 @@ reindex_system_catalogs(const char *dbname, const char *host, const char *port,
} }
PQfinish(conn); PQfinish(conn);
termPQExpBuffer(&sql); termPQExpBuffer(&sql);
if (!quiet)
{
puts("REINDEX");
fflush(stdout);
}
} }
static void static void
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.17 2007/04/09 18:21:22 mha Exp $ * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.18 2007/06/04 10:02:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -18,7 +18,7 @@ static void vacuum_one_database(const char *dbname, bool full, bool verbose, boo ...@@ -18,7 +18,7 @@ static void vacuum_one_database(const char *dbname, bool full, bool verbose, boo
const char *table, const char *table,
const char *host, const char *port, 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);
static void vacuum_all_databases(bool full, bool verbose, bool analyze, static void vacuum_all_databases(bool full, bool verbose, bool analyze,
const char *host, const char *port, const char *host, const char *port,
const char *username, bool password, const char *username, bool password,
...@@ -163,7 +163,7 @@ main(int argc, char *argv[]) ...@@ -163,7 +163,7 @@ main(int argc, char *argv[])
vacuum_one_database(dbname, full, verbose, analyze, table, vacuum_one_database(dbname, full, verbose, analyze, table,
host, port, username, password, host, port, username, password,
progname, echo, quiet); progname, echo);
} }
exit(0); exit(0);
...@@ -175,7 +175,7 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, ...@@ -175,7 +175,7 @@ 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 *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)
{ {
PQExpBufferData sql; PQExpBufferData sql;
...@@ -208,12 +208,6 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, ...@@ -208,12 +208,6 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze,
} }
PQfinish(conn); PQfinish(conn);
termPQExpBuffer(&sql); termPQExpBuffer(&sql);
if (!quiet)
{
puts("VACUUM");
fflush(stdout);
}
} }
...@@ -236,11 +230,14 @@ vacuum_all_databases(bool full, bool verbose, bool analyze, ...@@ -236,11 +230,14 @@ vacuum_all_databases(bool full, bool verbose, bool analyze,
char *dbname = PQgetvalue(result, i, 0); char *dbname = PQgetvalue(result, i, 0);
if (!quiet) if (!quiet)
fprintf(stderr, _("%s: vacuuming database \"%s\"\n"), progname, dbname); {
printf(_("%s: vacuuming database \"%s\"\n"), progname, dbname);
fflush(stdout);
}
vacuum_one_database(dbname, full, verbose, analyze, NULL, vacuum_one_database(dbname, full, verbose, analyze, NULL,
host, port, username, password, host, port, username, password,
progname, echo, quiet); progname, echo);
} }
PQclear(result); PQclear(result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment