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>
From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Daniel Bauman <danielbaniel@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-28T23:53:20Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid regression in the size of XML input that we will accept.
- 71c0921b649d 19 (unreleased) cited
On Monday, July 28, 2025, Bruce Momjian <bruce@momjian.us> wrote: > On Mon, Jul 28, 2025 at 04:24:14PM -0700, Daniel Bauman wrote: > > Here's where I think the logging is happening. https://github.com/ > postgres/ > > postgres/blob/master/src/backend/tcop/postgres.c#L1070 > > It seems like the log is happening before application of the > transaction, not > > after. > > > > So consistency is best effort. ie - a crash after the log but before the > > transaction is committed could result in a logged statement that wasn't > > actually committed. Your invalid assumption that commit/transaction is at all relevant here is not something we’ve induced. A select query returns the results to a client regardless of whether the transaction it is executed within is committed or rolled back. Not logging such a query because the transaction was rolled back would be an insane design choice. The only true “best-effort” consideration would be if somehow the logging itself was flaky, say under system load, such that attempted writes to disk somehow never made it there. I suppose in the case of a crash and “sync” patterns there may be a latent bug or active design choice to not let those syncs bog down the system…but that hasn’t been shown and I wouldn’t expect it to exist absent such documentation. It’s definitely not correct to call what we have best-effort. It’s just normal logging of valid statements presented for execution. A normal type of audit trail of what work the system performed. David J.