Type: | enum |
Default: | fdatasync |
Context: | sighup |
Restart: | false |
Values: | [fsync, fdatasync, open_sync, open_datasync] |
Method used for forcing WAL updates out to disk. If fsync is off then this setting is irrelevant, since WAL file updates will not be forced out at all. Possible values are:
-
open_datasync
(write WAL files with open() optionO_DSYNC
) -
fdatasync
(call fdatasync() at each commit) -
fsync
(call fsync() at each commit) -
fsync_writethrough
(call fsync() at each commit, forcing write-through of any disk write cache) -
open_sync
(write WAL files with open() optionO_SYNC
)
Not all of these choices are available on all platforms. The default is the first method in the above list that is supported by the platform, except that fdatasync
is the default on Linux and FreeBSD. The default is not necessarily ideal; it might be necessary to change this setting or other aspects of your system configuration in order to create a crash-safe configuration or achieve optimal performance. These aspects are discussed in wal-reliability. This parameter can only be set in the postgresql.conf file or on the server command line.