Skip to content

Commit 9539e64

Browse files
committed
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.
1 parent efbd5bc commit 9539e64

14 files changed

+69
-161
lines changed

doc/src/sgml/ref/clusterdb.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.21 2007/03/26 17:23:36 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.22 2007/06/04 10:02:40 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -102,7 +102,7 @@ PostgreSQL documentation
102102
<term><option>--quiet</></term>
103103
<listitem>
104104
<para>
105-
Do not display a response.
105+
Do not display progress messages.
106106
</para>
107107
</listitem>
108108
</varlistentry>

doc/src/sgml/ref/createdb.sgml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.44 2007/03/26 17:23:36 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.45 2007/06/04 10:02:40 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -129,16 +129,6 @@ PostgreSQL documentation
129129
</listitem>
130130
</varlistentry>
131131

132-
<varlistentry>
133-
<term><option>-q</></term>
134-
<term><option>--quiet</></term>
135-
<listitem>
136-
<para>
137-
Do not display a response.
138-
</para>
139-
</listitem>
140-
</varlistentry>
141-
142132
<varlistentry>
143133
<term><option>-T <replaceable class="parameter">template</replaceable></></term>
144134
<term><option>--template <replaceable class="parameter">template</replaceable></></term>

doc/src/sgml/ref/createuser.sgml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/createuser.sgml,v 1.47 2007/03/26 17:23:36 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/createuser.sgml,v 1.48 2007/06/04 10:02:40 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -242,16 +242,6 @@ PostgreSQL documentation
242242
</para>
243243
</listitem>
244244
</varlistentry>
245-
246-
<varlistentry>
247-
<term><option>-q</></term>
248-
<term><option>--quiet</></term>
249-
<listitem>
250-
<para>
251-
Do not display a response.
252-
</para>
253-
</listitem>
254-
</varlistentry>
255245
</variablelist>
256246
</para>
257247

doc/src/sgml/ref/dropdb.sgml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.31 2007/03/26 17:23:36 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.32 2007/06/04 10:02:40 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -85,16 +85,6 @@ PostgreSQL documentation
8585
</para>
8686
</listitem>
8787
</varlistentry>
88-
89-
<varlistentry>
90-
<term><option>-q</></term>
91-
<term><option>--quiet</></term>
92-
<listitem>
93-
<para>
94-
Do not display a response.
95-
</para>
96-
</listitem>
97-
</varlistentry>
9888
</variablelist>
9989
</para>
10090

doc/src/sgml/ref/dropuser.sgml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.36 2007/03/26 17:23:36 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.37 2007/06/04 10:02:40 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -87,16 +87,6 @@ PostgreSQL documentation
8787
</para>
8888
</listitem>
8989
</varlistentry>
90-
91-
<varlistentry>
92-
<term><option>-q</></term>
93-
<term><option>--quiet</></term>
94-
<listitem>
95-
<para>
96-
Do not display a response.
97-
</para>
98-
</listitem>
99-
</varlistentry>
10090
</variablelist>
10191
</para>
10292

doc/src/sgml/ref/reindexdb.sgml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,27 @@ PostgreSQL documentation
7575
</varlistentry>
7676

7777
<varlistentry>
78-
<term><option>-s</></term>
79-
<term><option>--system</></term>
78+
<term><option><optional>-d</> <replaceable class="parameter">dbname</replaceable></></term>
79+
<term><option><optional>--dbname</> <replaceable class="parameter">dbname</replaceable></></term>
8080
<listitem>
8181
<para>
82-
Reindex database's system catalogs.
82+
Specifies the name of the database to be reindexed.
83+
If this is not specified and <option>-a</option> (or
84+
<option>--all</option>) is not used, the database name is read
85+
from the environment variable <envar>PGDATABASE</envar>. If
86+
that is not set, the user name specified for the connection is
87+
used.
8388
</para>
8489
</listitem>
8590
</varlistentry>
8691

8792
<varlistentry>
88-
<term><option>-t <replaceable class="parameter">table</replaceable></></term>
89-
<term><option>--table <replaceable class="parameter">table</replaceable></></term>
93+
<term><option>-e</></term>
94+
<term><option>--echo</></term>
9095
<listitem>
9196
<para>
92-
Reindex <replaceable class="parameter">table</replaceable> only.
97+
Echo the commands that <application>reindexdb</application> generates
98+
and sends to the server.
9399
</para>
94100
</listitem>
95101
</varlistentry>
@@ -105,41 +111,34 @@ PostgreSQL documentation
105111
</varlistentry>
106112

107113
<varlistentry>
108-
<term><option><optional>-d</> <replaceable class="parameter">dbname</replaceable></></term>
109-
<term><option><optional>--dbname</> <replaceable class="parameter">dbname</replaceable></></term>
114+
<term><option>-q</></term>
115+
<term><option>--quiet</></term>
110116
<listitem>
111117
<para>
112-
Specifies the name of the database to be reindexed.
113-
If this is not specified and <option>-a</option> (or
114-
<option>--all</option>) is not used, the database name is read
115-
from the environment variable <envar>PGDATABASE</envar>. If
116-
that is not set, the user name specified for the connection is
117-
used.
118+
Do not display progress messages.
118119
</para>
119120
</listitem>
120121
</varlistentry>
121122

122123
<varlistentry>
123-
<term><option>-e</></term>
124-
<term><option>--echo</></term>
124+
<term><option>-s</></term>
125+
<term><option>--system</></term>
125126
<listitem>
126127
<para>
127-
Echo the commands that <application>reindexdb</application> generates
128-
and sends to the server.
128+
Reindex database's system catalogs.
129129
</para>
130130
</listitem>
131131
</varlistentry>
132132

133133
<varlistentry>
134-
<term><option>-q</></term>
135-
<term><option>--quiet</></term>
134+
<term><option>-t <replaceable class="parameter">table</replaceable></></term>
135+
<term><option>--table <replaceable class="parameter">table</replaceable></></term>
136136
<listitem>
137137
<para>
138-
Do not display a response.
138+
Reindex <replaceable class="parameter">table</replaceable> only.
139139
</para>
140140
</listitem>
141141
</varlistentry>
142-
143142
</variablelist>
144143
</para>
145144

doc/src/sgml/ref/vacuumdb.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.40 2007/03/26 17:23:37 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.41 2007/06/04 10:02:40 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -119,7 +119,7 @@ PostgreSQL documentation
119119
<term><option>--quiet</></term>
120120
<listitem>
121121
<para>
122-
Do not display a response.
122+
Do not display progress messages.
123123
</para>
124124
</listitem>
125125
</varlistentry>

src/bin/scripts/clusterdb.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 2002-2007, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.17 2007/04/09 18:21:22 mha Exp $
7+
* $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.18 2007/06/04 10:02:40 petere Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -17,7 +17,7 @@
1717
static void cluster_one_database(const char *dbname, const char *table,
1818
const char *host, const char *port,
1919
const char *username, bool password,
20-
const char *progname, bool echo, bool quiet);
20+
const char *progname, bool echo);
2121
static void cluster_all_databases(const char *host, const char *port,
2222
const char *username, bool password,
2323
const char *progname, bool echo, bool quiet);
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
145145

146146
cluster_one_database(dbname, table,
147147
host, port, username, password,
148-
progname, echo, quiet);
148+
progname, echo);
149149
}
150150

151151
exit(0);
@@ -156,7 +156,7 @@ static void
156156
cluster_one_database(const char *dbname, const char *table,
157157
const char *host, const char *port,
158158
const char *username, bool password,
159-
const char *progname, bool echo, bool quiet)
159+
const char *progname, bool echo)
160160
{
161161
PQExpBufferData sql;
162162

@@ -183,12 +183,6 @@ cluster_one_database(const char *dbname, const char *table,
183183
}
184184
PQfinish(conn);
185185
termPQExpBuffer(&sql);
186-
187-
if (!quiet)
188-
{
189-
puts("CLUSTER");
190-
fflush(stdout);
191-
}
192186
}
193187

194188

@@ -210,11 +204,14 @@ cluster_all_databases(const char *host, const char *port,
210204
char *dbname = PQgetvalue(result, i, 0);
211205

212206
if (!quiet)
213-
fprintf(stderr, _("%s: clustering database \"%s\"\n"), progname, dbname);
207+
{
208+
printf(_("%s: clustering database \"%s\"\n"), progname, dbname);
209+
fflush(stdout);
210+
}
214211

215212
cluster_one_database(dbname, NULL,
216213
host, port, username, password,
217-
progname, echo, quiet);
214+
progname, echo);
218215
}
219216

220217
PQclear(result);

src/bin/scripts/createdb.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.22 2007/01/05 22:19:50 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.23 2007/06/04 10:02:40 petere Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -48,7 +48,6 @@ main(int argc, char *argv[])
4848
char *username = NULL;
4949
bool password = false;
5050
bool echo = false;
51-
bool quiet = false;
5251
char *owner = NULL;
5352
char *tablespace = NULL;
5453
char *template = NULL;
@@ -84,7 +83,7 @@ main(int argc, char *argv[])
8483
echo = true;
8584
break;
8685
case 'q':
87-
quiet = true;
86+
/* obsolete; remove in 8.4 */
8887
break;
8988
case 'O':
9089
owner = optarg;
@@ -175,12 +174,6 @@ main(int argc, char *argv[])
175174
PQclear(result);
176175
PQfinish(conn);
177176

178-
if (!quiet)
179-
{
180-
puts("CREATE DATABASE");
181-
fflush(stdout);
182-
}
183-
184177
if (comment)
185178
{
186179
conn = connectDatabase(dbname, host, port, username, password, progname);
@@ -203,11 +196,6 @@ main(int argc, char *argv[])
203196

204197
PQclear(result);
205198
PQfinish(conn);
206-
if (!quiet)
207-
{
208-
puts("COMMENT");
209-
fflush(stdout);
210-
}
211199
}
212200

213201
exit(0);
@@ -226,7 +214,6 @@ help(const char *progname)
226214
printf(_(" -O, --owner=OWNER database user to own the new database\n"));
227215
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
228216
printf(_(" -e, --echo show the commands being sent to the server\n"));
229-
printf(_(" -q, --quiet don't write any messages\n"));
230217
printf(_(" --help show this help, then exit\n"));
231218
printf(_(" --version output version information, then exit\n"));
232219
printf(_("\nConnection options:\n"));

src/bin/scripts/createuser.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.35 2007/01/05 22:19:50 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.36 2007/06/04 10:02:40 petere Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -63,7 +63,6 @@ main(int argc, char *argv[])
6363
char *username = NULL;
6464
bool password = false;
6565
bool echo = false;
66-
bool quiet = false;
6766
char *conn_limit = NULL;
6867
bool pwprompt = false;
6968
char *newpassword = NULL;
@@ -107,7 +106,7 @@ main(int argc, char *argv[])
107106
echo = true;
108107
break;
109108
case 'q':
110-
quiet = true;
109+
/* obsolete; remove in 8.4 */
111110
break;
112111
case 'd':
113112
createdb = TRI_YES;
@@ -297,11 +296,6 @@ main(int argc, char *argv[])
297296

298297
PQclear(result);
299298
PQfinish(conn);
300-
if (!quiet)
301-
{
302-
puts("CREATE ROLE");
303-
fflush(stdout);
304-
}
305299
exit(0);
306300
}
307301

@@ -329,7 +323,6 @@ help(const char *progname)
329323
printf(_(" -E, --encrypted encrypt stored password\n"));
330324
printf(_(" -N, --unencrypted do not encrypt stored password\n"));
331325
printf(_(" -e, --echo show the commands being sent to the server\n"));
332-
printf(_(" -q, --quiet don't write any messages\n"));
333326
printf(_(" --help show this help, then exit\n"));
334327
printf(_(" --version output version information, then exit\n"));
335328
printf(_("\nConnection options:\n"));

0 commit comments

Comments
 (0)