Bruce Momjian wrote:
>
> > > So, I think we are safe if we can either keep that file descriptor open
> > > until commit, or re-open it and fsync it on commit. That assume a
> > > re-open is hitting the same file. My opinion is that we should just
> > > fsync it on close and not worry about a reopen.
> >
> > I'm pretty sure that the standard is that a close on a file _should_
> > fsync it.
>
> This is not true. close flushes the user buffers to kernel buffers. It
> does not force to physical disk in all cases, I think.
fclose flushes user buffers to kernel buffers. close only frees the file
descriptor for re-use.