Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzmjS-0002b2-Js for pgsql-admin@arkaria.postgresql.org; Tue, 21 Dec 2021 21:31:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzmjR-0005fB-GB for pgsql-admin@arkaria.postgresql.org; Tue, 21 Dec 2021 21:31:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzmjR-0005ew-5t for pgsql-admin@lists.postgresql.org; Tue, 21 Dec 2021 21:31:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzmjM-00025N-Kl for pgsql-admin@lists.postgresql.org; Tue, 21 Dec 2021 21:31:36 +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 1BLLVML4161737; Tue, 21 Dec 2021 16:31:22 -0500 From: Tom Lane To: Nikolay Samokhvalov cc: Holger Jakobs , Daulat , pgsql-admin Subject: Re: How to Log DBA actions In-reply-to: References: Comments: In-reply-to Nikolay Samokhvalov message dated "Tue, 21 Dec 2021 13:25:36 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <161735.1640122282.1@sss.pgh.pa.us> Date: Tue, 21 Dec 2021 16:31:22 -0500 Message-ID: <161736.1640122282@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nikolay Samokhvalov writes: > On Sun, Dec 19, 2021 at 10:43 PM Holger Jakobs wrote: >> There is a setting log_statements which can be set to none (the default), >> ddl, mod or all > ..and, unfortunately, any user will be able to set it back via SET. Really? regression=# create user joe; CREATE ROLE regression=# \c - joe You are now connected to database "regression" as user "joe". regression=> set log_statement = none; ERROR: permission denied to set parameter "log_statement" It is true that superusers can change that variable. However, if you are trying to force monitoring of an uncooperative superuser, you are in for a hard slog. regards, tom lane