Re: Doc update proposal for the note on log_statement in the runtime config for logging page - Mailing list pgsql-hackers

From Daniel Bauman
Subject Re: Doc update proposal for the note on log_statement in the runtime config for logging page
Date
Msg-id CAMtj0_ZB6VB9wjp2f=yow=b8kd7fQN3V-g9swAPRDcHFKn9AvQ@mail.gmail.com
Whole thread Raw
In response to Re: Doc update proposal for the note on log_statement in the runtime config for logging page  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Tue, Jul 29, 2025 at 11:46 AM David G. Johnston <david.g.johnston@gmail.com> wrote:


On Tue, Jul 29, 2025, 10:07 Daniel Bauman <danielbaniel@gmail.com> wrote:

The main question is where to put such info.  The config settings section seems like an odd place to find that.

David J.


From looking through the docs I think that adding to the note under the log_statement is an appropriate place.
It already calls out other statement logging details like the fact that statements are only logged after basic validation and that statements can contain sensitive information.
I think adding a statement much like the MySQL wording is correct ( "Statement logging occurs on a best-effort basis, with no guarantee of consistency." is descriptive without getting into unnecessary details for the user about fsync, transactions and error handling. That could separately be discussed in the code comments for developers.
I think the best-effort wording is justified and it probably is for most DB engines. Error logging is not transactional, it's not part of the WAL. Even though statement logging happens before the tx is executed it isn't fsynced for each statement and write errors don't prevent transactions from being processed.

What do you think?

-Daniel

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Support getrandom() for pg_strong_random() source
Next
From: Jacob Champion
Date:
Subject: Re: restore_command return code behaviour