Postgresql – enabling fsync in postgresql 9.1

performancepostgresqlpostgresql-9.1postgresql-performance

currently fsync option is disabled in postgresql.conf.

If I am enable that,

From:

#fsync = on

To:

fsync = on

(I am enabling fsync to avoid data corruption if any failure since my data (tablespace created in mounted remote partition) is available in remote location)

should I need to consider consider below properties also?

#synchronous_commit = on
#wal_sync_method = fsync

Should I need to enabled above configuration also?

Best Answer

If you've not changed those parameters they should be enabled by default.

You should only need to uncomment them if you're going to change them.

You can check the running parameters for the server with SHOW ALL; or by specific parameter, e.g. SHOW fsync; on the psql command line.

The wal_sync_method should default to a best guessed method for your platform, most likely fdatasync on Linux or fsync on most other operating systems.

You can read more about these parameters in the WAL runtime config documentation

However, it is awesome that you care enough to double-check all this. =)

Related Question