Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfOT8-00Anf1-Oy for pgsql-general@arkaria.postgresql.org; Sun, 10 Sep 2023 17:43:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qfOT5-00AsMD-U3 for pgsql-general@arkaria.postgresql.org; Sun, 10 Sep 2023 17:43:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfOT5-00AsM5-Hp for pgsql-general@lists.postgresql.org; Sun, 10 Sep 2023 17:43:31 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfOT1-003ot1-Oz for pgsql-general@lists.postgresql.org; Sun, 10 Sep 2023 17:43:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38AHhPjA2400458; Sun, 10 Sep 2023 13:43:25 -0400 From: Tom Lane To: "David G. Johnston" cc: Les , pgsql-general@lists.postgresql.org Subject: Re: pgsql --echo-errors --quiet and setval In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Fri, 08 Sep 2023 15:01:50 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2400456.1694367805.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 10 Sep 2023 13:43:25 -0400 Message-ID: <2400457.1694367805@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Fri, Sep 8, 2023 at 1:41 PM Les 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