Home Explore Blog CI



postgresql

48th chunk of `doc/src/sgml/config.sgml`
cf4eaf6424de7dad8e9c2ca5644adb7ec91e6a5e0793044d0000000100000fa4
 for
        local flush to disk, but not for replication.  This is usually not
        desirable when synchronous replication is in use, but is provided for
        completeness.
       </para>

       <para>
        This parameter can be changed at any time; the behavior for any
        one transaction is determined by the setting in effect when it
        commits.  It is therefore possible, and useful, to have some
        transactions commit synchronously and others asynchronously.
        For example, to make a single multistatement transaction commit
        asynchronously when the default is the opposite, issue <command>SET
        LOCAL synchronous_commit TO OFF</command> within the transaction.
       </para>

       <para>
        <xref linkend="synchronous-commit-matrix"/> summarizes the
        capabilities of the <varname>synchronous_commit</varname> settings.
       </para>

       <table id="synchronous-commit-matrix">
        <title>synchronous_commit Modes</title>
        <tgroup cols="5">
         <colspec colname="col1" colwidth="1.5*"/>
         <colspec colname="col2" colwidth="1*"/>
         <colspec colname="col3" colwidth="1*"/>
         <colspec colname="col4" colwidth="1*"/>
         <colspec colname="col5" colwidth="1*"/>
         <thead>
          <row>
           <entry>synchronous_commit setting</entry>
           <entry>local durable commit</entry>
           <entry>standby durable commit after PG crash</entry>
           <entry>standby durable commit after OS crash</entry>
           <entry>standby query consistency</entry>
          </row>
         </thead>

         <tbody>

          <row>
           <entry>remote_apply</entry>
           <entry align="center">&bull;</entry>
           <entry align="center">&bull;</entry>
           <entry align="center">&bull;</entry>
           <entry align="center">&bull;</entry>
          </row>

          <row>
           <entry>on</entry>
           <entry align="center">&bull;</entry>
           <entry align="center">&bull;</entry>
           <entry align="center">&bull;</entry>
           <entry align="center"></entry>
          </row>

          <row>
           <entry>remote_write</entry>
           <entry align="center">&bull;</entry>
           <entry align="center">&bull;</entry>
           <entry align="center"></entry>
           <entry align="center"></entry>
          </row>

          <row>
           <entry>local</entry>
           <entry align="center">&bull;</entry>
           <entry align="center"></entry>
           <entry align="center"></entry>
           <entry align="center"></entry>
          </row>

          <row>
           <entry>off</entry>
           <entry align="center"></entry>
           <entry align="center"></entry>
           <entry align="center"></entry>
           <entry align="center"></entry>
          </row>

         </tbody>
        </tgroup>
       </table>

      </listitem>
     </varlistentry>

     <varlistentry id="guc-wal-sync-method" xreflabel="wal_sync_method">
      <term><varname>wal_sync_method</varname> (<type>enum</type>)
      <indexterm>
       <primary><varname>wal_sync_method</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
        Method used for forcing WAL updates out to disk.
        If <varname>fsync</varname> is off then this setting is irrelevant,
        since WAL file updates will not be forced out at all.
        Possible values are:
       </para>
       <itemizedlist>
        <listitem>
        <para>
         <literal>open_datasync</literal> (write WAL files with <function>open()</function> option <symbol>O_DSYNC</symbol>)
        </para>
        </listitem>
        <listitem>
        <para>
         <literal>fdatasync</literal> (call <function>fdatasync()</function> at each commit)
        </para>
        </listitem>
        <listitem>
        <para>
         <literal>fsync</literal> (call <function>fsync()</function> at each

Title: Synchronous Commit Modes Table and WAL Sync Method
Summary
The text details the synchronous commit modes through a table that outlines the capabilities of each setting (remote_apply, on, remote_write, local, off) in terms of local durable commit, standby durable commit after PG/OS crash, and standby query consistency. It also describes how to change the synchronous commit setting and enable asynchronous commits. The text transitions to the wal_sync_method, an enum that defines the method used for forcing WAL updates to disk. It lists possible values like open_datasync, fdatasync, and fsync, noting its relevance when fsync is enabled.