On Tue, Aug 17, 2021, at 8:06 AM, Daniel Gustafsson wrote:
Julien Rouhaud also pointed out off-list that the help output and documentation
aren't in agreement about how --quiet works. In the documentation we say:
"Print fewer messages, and less detail regarding any server errors."
But the help output takes a stronger position on this:
$ ./bin/pg_amcheck --help |grep quiet
-q, --quiet don't write any messages
The latter isn't entirely true IMO, so I think we should reconcile them with
something like this while in here and fixing things anyways:
I suggest that it should be a message that we already use in another binaries
such as "do not print any output, except for errors". This message is probably
more accurate than "don't write any messages" even for the other binaries
(clusterdb, reindexdb, and vacuumdb) too.
For example, vacuumdb prints an error message even though --quiet is provided.
$ vacuumdb -d postgres -p 8888 --quiet
vacuumdb: error: connection to server on socket "/tmp/.s.PGSQL.8888" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
quiet option is not strict; it doesn't omit *all* messages (including fatal or
error messages). We can debate if the current behavior is fine for most use
cases. It might surprise users while writing a script that they should discard
the standard error output even though the command contains a --quiet option.
That's a different (but related) patch but IMO we should change the --help
description because it is (a) not accurate and (b) doesn't match the
documentation: "don't write any messages" vs "Do not display progress
messages".