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 1mzm8o-0001U5-56 for pgsql-admin@arkaria.postgresql.org; Tue, 21 Dec 2021 20:53:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzm8m-00032G-EU for pgsql-admin@arkaria.postgresql.org; Tue, 21 Dec 2021 20:53:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzm8m-000326-3a for pgsql-admin@lists.postgresql.org; Tue, 21 Dec 2021 20:53:44 +0000 Received: from mail-wr1-f48.google.com ([209.85.221.48]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mzm8k-0000P2-3A for pgsql-admin@lists.postgresql.org; Tue, 21 Dec 2021 20:53:43 +0000 Received: by mail-wr1-f48.google.com with SMTP id d9so592686wrb.0 for ; Tue, 21 Dec 2021 12:53:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SthCAQBe8tu8RDbn5qNpkAIUZC+0MYD/IDLNicoQLeY=; b=iO516fiROgLAvE1l9iUETLXKkxwU1WvcnzjzWEoT1MYvVZVJsUamy7vUvmjWcVt5aT gaZD13DITmVy3WitN1tdg1igFsKJVIKAsPwVUx5KDYrTqWCZa+vaTpL4i2SZv8x1FwHe 7f3SrmZEPOC4gt1Q/KT0SxiBbjDsxXBm4yeibAYGCUWMXnUzh4aToLXSY6rFbAzN1vs9 58ER1+YfEkr2vA6IVkMVcodrVC5DWxczILiv8466lLyGGLzmHflL1UzOICpJ7rh0MO+I f6NFGai4480H5cDpLQyE8Am+dOFQFoC7P+po4/2KzWExxGt8xUVbTSzD/WFh94zqt3yL +gvg== X-Gm-Message-State: AOAM532Dd5SYRdiL+WgrvNP/I+FJ0RKxTO0KppQcgzlAtnuGyJQyrQzW Bay/9lrZRGqeuXGhcORy3o+yaAg6nKA= X-Google-Smtp-Source: ABdhPJz6ArWrFFZJXilWZ5cqZs3ABH68hy5jYim6kk/ZKxJAM2BF0vx33G56E7LyFKkyEFaMIBQLxg== X-Received: by 2002:adf:f112:: with SMTP id r18mr4163546wro.655.1640120020446; Tue, 21 Dec 2021 12:53:40 -0800 (PST) Received: from lightning.caipicrew.dd-dns.de ([2001:a61:3b05:f201:ad43:9690:63e7:a0e4]) by smtp.gmail.com with ESMTPSA id b19sm3744111wmb.38.2021.12.21.12.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 12:53:40 -0800 (PST) Message-ID: <61c23ed4.1c69fb81.e4f24.27ac@mx.google.com> X-Google-Original-Message-ID: <20211221205339.GH32283@caipicrew.dd-dns.de;lightning.caipicrew.dd-dns.de> Received: from mbanck by lightning.caipicrew.dd-dns.de with local (Exim 4.92) (envelope-from ) id 1mzm8h-00086m-BH; Tue, 21 Dec 2021 21:53:39 +0100 Date: Tue, 21 Dec 2021 21:53:39 +0100 From: Michael Banck To: Daulat Cc: Holger Jakobs , pgsql-admin Subject: Re: How to Log DBA actions References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 20, 2021 at 12:24:14PM +0530, Daulat wrote: > It means, there is no use of pgaudit if we already have log_statements > enabled? It depends. log_statments, logs *all* statements of the particular type, so if you want to log whether the DBA do any data changes at all and set it to "mod", that means, any other data changes (from the application) will get logged as well. Maybe you can live with just log_statement = ddl, or you can set role-specific log_statement = mod,ddl for the DBA roles (this might not work on a managed Postgres service). If not, pgaudit allows to log much more fine-grained and targetted audit events. Michael