Re: Using pgAudit to audit interesting tables for all users except for batch user?

Greg Sabino Mullane <htamfids@gmail.com>

From: Greg Sabino Mullane <htamfids@gmail.com>
To: "Colin 't Hart" <colinthart@gmail.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Date: 2025-11-18T15:10:46Z
Lists: pgsql-general
On Tue, Nov 18, 2025 at 4:18 AM Colin 't Hart <colinthart@gmail.com> wrote:

> alter user <batchuser> set pgaudit.log to 'none';
>

That's close! pgaudit.log deals with session level things, but you want to
exclude object-level things. Try:

create role skip_pguadit;
alter user <batchuser> set pgaudit.role = 'skip_pgaudit';


Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support