Prima Chairunnanda <prima.ch@gmail.com> writes:
> I am really unsure about point 2, because I couldn't find any definite
> statement whether a dirty page could be written before transaction commits.
Certainly. Were that not so, how would we handle mass update
transactions (where "mass" means "dirties more pages than can fit in
shared_buffers")?
Dirty pages can be written out at any time, subject only to the WAL rule
that the relevant WAL records have to be flushed to disk first. The
buffer manager checks that by comparing the page's LSN field to the
globally-visible latest WAL flush location.
regards, tom lane