pg.ddx.io  pgaudit/pgaudit GitHub issues and pull requests  
help / color / mirror / Atom feed
From: baumand-amazon (@baumand-amazon) <noreply+baumand-amazon@github.com>
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
Subject: [pgaudit/pgaudit] issue #280: Update PGAudit docs to document its consistency model
Date: Tue, 22 Jul 2025 19:36:50 +0000
Message-ID: <gh-pgaudit-pgaudit-280@github.com> (raw)

It is my understanding that PGAudit logs are not transactional in the way that statements in a DB transaction are. In other words, when a transaction is committed in the DB there's a window where the host can power off or crash and lose the associated PGAudit entry.
EG: A crash after the WAL is flushed but before the PGAudit log disk write is made persistent (ie - PGAudit doesn't fsync). Another example could be a transaction committing and then PGAudit encountering a disk full error on the log partition.

A comparative example from MySql which I believe has the same consistency model - https://dev.mysql.com/doc/refman/8.4/en/audit-log-logging-configuration.html
"Regardless of strategy, logging occurs on a best-effort basis, with no guarantee of consistency."

PGAudit positions itself as an audit and compliance tool - https://github.com/pgaudit/pgaudit/blob/main/README.md
Therefore being clear and explicit about guarantees for logging is important for users.

It's my understanding that PGAudit uses `ereport`. And `ereport` does not (of course, for perf and availability reasons) perform an `fsync` after every write nor does it propagate errors if there's an issue completing the write.

view thread (7+ messages)  latest in thread

Message-ID: <gh-pgaudit-pgaudit-280@github.com>
Permalink:  ../gh-pgaudit-pgaudit-280@github.com/

 · 


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