Adjusting durability

In this chapter, you have seen that data is either replicated synchronously or asynchronously. However, this is not a global thing. To ensure good performance, PostgreSQL allows you to configure things in a very flexible way. It is possible to replicate everything synchronously or asynchronously, but in many cases you might want to do things in a more fine-grained way. This is exactly when the synchronous_commit setting is needed.

Assuming that synchronous replication has been configured (the application_name setting in the recovery.conf file as well as the synchronous_standby_names setting in the postgresql.conf file), the synchronous_commit setting will offer the following options:

  • off: This is basically asynchronous ...

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.