Re: BUG #17148: About --no-strict-names option and --quiet option of pg_amcheck command

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Daniel Gustafsson" <daniel(at)yesql(dot)se>, chenjq(dot)jy(at)fujitsu(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: "Julien Rouhaud" <rjuju123(at)gmail(dot)com>
Subject: Re: BUG #17148: About --no-strict-names option and --quiet option of pg_amcheck command
Date: 2021-08-17 14:53:07
Message-ID: fb17eac7-f5cf-4e6f-9b67-f5fb4855d1d9@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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".

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2021-08-17 15:57:36 Re: BUG #17148: About --no-strict-names option and --quiet option of pg_amcheck command
Previous Message Tom Lane 2021-08-17 13:35:50 Re: ALTER TYPE vs extension membership (was Re: BUG #17144: Upgrade from v13 to v14 with the cube extension failed)