pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gustavsson Mikael <mikael.gustavsson@smhi.se>
To: Ayub M <hiayub@gmail.com>
To: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: SV: postgres auditing truncates and deletes on tables
Date: Thu, 17 Dec 2020 07:43:26 +0000
Message-ID: <d0c51c935a86409ba6dad26d4679e1fd@smhi.se> (raw)
In-Reply-To: <CAOS0qEu5uLicZepS5ec0ksuYbwaGzJXTxzpyCihk3ZU4UDsmGA@mail.gmail.com>
References: <CAOS0qEu5uLicZepS5ec0ksuYbwaGzJXTxzpyCihk3ZU4UDsmGA@mail.gmail.com>

Hi,


I have used this setup to do something similar.


https://github.com/2ndQuadrant/audit-trigger


KR, Mikael Gustavsson

________________________________
Från: Ayub M <hiayub@gmail.com>
Skickat: den 15 december 2020 18:13:39
Till: PostgreSQL General
Ämne: postgres auditing truncates and deletes on tables


for an RDS Aurora PostgreSQL v11.7 database I want to setup DDL and truncate and delete auditing.

I am setting log_statement to DDL, to log all DDLs (this excludes truncate statements). I also want to setup auditing only for deletes and truncates on tables. I don't want to set log_statement to all, as this would fill up my logs.

Checking in pg_audit, it supports write class which includes delete and truncate, but it also includes write/update and copy which I don't need.

Is there any way to setup auditing to audit DDL plus deletes/truncates only using pg_audit/native auditing?

Message-ID: <d0c51c935a86409ba6dad26d4679e1fd@smhi.se>
Permalink:  ../d0c51c935a86409ba6dad26d4679e1fd@smhi.se/
Also on:    postgresql.org/message-id/d0c51c935a86409ba6dad26d4679e1fd@smhi.se

 · 

reply

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: mikael.gustavsson@smhi.se, hiayub@gmail.com
  Subject: Re: postgres auditing truncates and deletes on tables
  In-Reply-To: <d0c51c935a86409ba6dad26d4679e1fd@smhi.se>
  References: <CAOS0qEu5uLicZepS5ec0ksuYbwaGzJXTxzpyCihk3ZU4UDsmGA@mail.gmail.com> <d0c51c935a86409ba6dad26d4679e1fd@smhi.se>

* 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