Bruce Momjian wrote:
>
> >
> > Hi,
> >
> > perhaps a stupid question:
> >
> > What will happen, if you start PostgreSQL with -F and write a script
> > which is a loop that fsyncs every 2 seconds? Does this lead to a
> > database which is "almost" correct? Does this seem like a good
> > compromise?
>
> Well, you really have to sync the data pages BEFORE sync'ing pg_log.
Why should this be necessary? If the transaction is considered
committed once the log has be written, and the system crashes before
the data are written, then postgres can look at the data and logs when
it is next started up and apply all the transactions that were logged
but not committed to the data pages.
Am I missing something? It seems to me if you sync the data pages
first, then what good is the log? (other than being able to retrace
your steps)
Ocie Mitchell