From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Les <nagylzs@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pgsql --echo-errors --quiet and setval
Date: Sun, 10 Sep 2023 13:43:25 -0400
Message-ID: <2400457.1694367805@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwbzKMJW4F2enc6rL4VP2o2bAj5v9EcfsoCTfXUZGtAPuw@mail.gmail.com>
References: <CAKXe9UB-zH6Tn2hbvCON8n=twcOV02UskEvB3UGGs_+nD4fYOw@mail.gmail.com>
<CAKFQuwbzKMJW4F2enc6rL4VP2o2bAj5v9EcfsoCTfXUZGtAPuw@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Fri, Sep 8, 2023 at 1:41 PM Les <nagylzs@gmail.com> wrote:
>> Today I caught this with postgresql v15, while restoring a database with
>> psql --echo-errors --quiet. (The dump was made using pg_dump -Fp).
>> It logged lots of these messages:
>>
>> setval
>> --------
>> 1001
>> (1 row)
>>
>> In other words, it logs **some** things that are not errors, even though
>> --quiet was specified. Is this the expected behaviour? I would argue that
>> with --quiet --echo-errors, only errors should be logged, and setting the
>> value of a sequence is not an error.
> The output of SELECT queries cannot be quieted, only redirected.
Yeah. You could do "\o /dev/null" or the equivalent to discard the
SELECT results, since a pg_dump script isn't going to be doing anything
that you really need to see the results of.
I'm not sure whether it'd be profitable to try to build that behavior
into the scripts themselves. One problem is that "/dev/null" doesn't
have that name on Windows, so it's hard to see how to invoke the behavior
in a platform-agnostic fashion.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, nagylzs@gmail.com
Subject: Re: pgsql --echo-errors --quiet and setval
In-Reply-To: <2400457.1694367805@sss.pgh.pa.us>
References: <CAKXe9UB-zH6Tn2hbvCON8n=twcOV02UskEvB3UGGs_+nD4fYOw@mail.gmail.com> <CAKFQuwbzKMJW4F2enc6rL4VP2o2bAj5v9EcfsoCTfXUZGtAPuw@mail.gmail.com> <2400457.1694367805@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox