Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIfqZ-0003Zf-4v for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2019 20:47:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIfqX-0001qI-Nb for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2019 20:47:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIfqX-0001kN-B0 for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2019 20:47:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIfqV-0000fd-3w for pgsql-general@postgresql.org; Mon, 22 Apr 2019 20:47:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3MKlKHi026064; Mon, 22 Apr 2019 16:47:20 -0400 From: Tom Lane To: Jeremy Finzel cc: Postgres General Subject: Re: Why does log_error_verbosity not apply to server logs? In-reply-to: References: Comments: In-reply-to Jeremy Finzel message dated "Mon, 22 Apr 2019 15:30:41 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26061.1555966040.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 22 Apr 2019 16:47:20 -0400 Message-ID: <26062.1555966040@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jeremy Finzel writes: > I have a DO block which is raising a log message with number of rows > deleted. It also shows CONTEXT messages every time, which I don't want. > But setting in the client log_error_verbosity =3D terse does not work to= get > rid of the messages. I can't get it to work even setting it on a per-us= er > level. > My client shows terse verbosity as expected, but the server logs always = no > matter what have CONTEXT messages. Sure sounds to me like what you are setting is something client-side, not the server's log verbosity. It works for me: regression=3D# do $$ declare x int; y int =3D 0; begin x :=3D 1/y; end$$; psql: ERROR: division by zero CONTEXT: PL/pgSQL function inline_code_block line 1 at assignment regression=3D# set log_error_verbosity =3D terse; SET regression=3D# do $$ declare x int; y int =3D 0; begin x :=3D 1/y; end$$; psql: ERROR: division by zero CONTEXT: PL/pgSQL function inline_code_block line 1 at assignment after which I see this in the postmaster log: 2019-04-22 16:40:38.300 EDT [25788] ERROR: division by zero 2019-04-22 16:40:38.300 EDT [25788] CONTEXT: PL/pgSQL function inline_cod= e_block line 1 at assignment 2019-04-22 16:40:38.300 EDT [25788] STATEMENT: do $$ declare x int; y int= =3D 0; begin x :=3D 1/y; end$$; 2019-04-22 16:40:51.654 EDT [25788] ERROR: division by zero 2019-04-22 16:40:51.654 EDT [25788] STATEMENT: do $$ declare x int; y int= =3D 0; begin x :=3D 1/y; end$$; Note that this changed the server log verbosity but *not* what was displayed on the client side. (BTW, if you want to get rid of the statement logging as well, see log_min_error_statement.) Also note that adjusting log_error_verbosity on the fly like this requires being superuser, which isn't really a good way to run in production. I'd expect though that you could apply it with ALTER USER SET. regards, tom lane