Doc: document the current-transaction-modes GUCs.
authorTom Lane <[email protected]>
Sat, 17 Jul 2021 15:52:54 +0000 (11:52 -0400)
committerTom Lane <[email protected]>
Sat, 17 Jul 2021 15:52:54 +0000 (11:52 -0400)
We had documentation of default_transaction_isolation et al,
but for some reason not of transaction_isolation et al.
AFAICS this is just an ancient oversight, so repair.

Per bug #17077 from Yanliang Lei.

Discussion: https://postgr.es/m/17077-ade8e166a01e1374@postgresql.org

doc/src/sgml/config.sgml
doc/src/sgml/ref/set_transaction.sgml

index a98919ae90f14980e7e545be115c777c76c9ed80..600359ed3975c87e6fe5a08d7bb46e8d72379567 100644 (file)
@@ -6611,6 +6611,68 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
       </listitem>
      </varlistentry>
 
+     <varlistentry id="guc-transaction-isolation" xreflabel="transaction_isolation">
+      <term><varname>transaction_isolation</varname> (<type>enum</type>)
+      <indexterm>
+       <primary>transaction isolation level</primary>
+      </indexterm>
+      <indexterm>
+       <primary><varname>transaction_isolation</varname> configuration parameter</primary>
+      </indexterm>
+      </term>
+      <listitem>
+       <para>
+        This parameter reflects the current transaction's isolation level.
+        At the beginning of each transaction, it is set to the current value
+        of <xref linkend="guc-default-transaction-isolation">.
+        Any subsequent attempt to change it is equivalent to a <xref
+        linkend="sql-set-transaction"> command.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry id="guc-transaction-read-only" xreflabel="transaction_read_only">
+      <term><varname>transaction_read_only</varname> (<type>boolean</type>)
+      <indexterm>
+       <primary>read-only transaction</primary>
+       <secondary>setting default</secondary>
+      </indexterm>
+      <indexterm>
+       <primary><varname>transaction_read_only</varname> configuration parameter</primary>
+      </indexterm>
+      </term>
+      <listitem>
+       <para>
+        This parameter reflects the current transaction's read-only status.
+        At the beginning of each transaction, it is set to the current value
+        of <xref linkend="guc-default-transaction-read-only">.
+        Any subsequent attempt to change it is equivalent to a <xref
+        linkend="sql-set-transaction"> command.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry id="guc-transaction-deferrable" xreflabel="transaction_deferrable">
+      <term><varname>transaction_deferrable</varname> (<type>boolean</type>)
+      <indexterm>
+       <primary>deferrable transaction</primary>
+       <secondary>setting default</secondary>
+      </indexterm>
+      <indexterm>
+       <primary><varname>transaction_deferrable</varname> configuration parameter</primary>
+      </indexterm>
+      </term>
+      <listitem>
+       <para>
+        This parameter reflects the current transaction's deferrability status.
+        At the beginning of each transaction, it is set to the current value
+        of <xref linkend="guc-default-transaction-deferrable">.
+        Any subsequent attempt to change it is equivalent to a <xref
+        linkend="sql-set-transaction"> command.
+       </para>
+      </listitem>
+     </varlistentry>
+
 
      <varlistentry id="guc-session-replication-role" xreflabel="session_replication_role">
       <term><varname>session_replication_role</varname> (<type>enum</type>)
index 6ade2501b8257c3ff5336121d0f709a970c1e130..0af0c59cc5d2e55212e82a2bcb095e935d5c8cdb 100644 (file)
@@ -202,7 +202,7 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
   </para>
 
   <para>
-   The session default transaction modes can also be set by setting the
+   The session default transaction modes can also be set or examined via the
    configuration parameters <xref linkend="guc-default-transaction-isolation">,
    <xref linkend="guc-default-transaction-read-only">, and
    <xref linkend="guc-default-transaction-deferrable">.
@@ -212,6 +212,17 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
    <command>ALTER DATABASE</>, etc.  Consult <xref linkend="runtime-config">
    for more information.
   </para>
+
+  <para>
+   The current transaction's modes can similarly be set or examined via the
+   configuration parameters <xref linkend="guc-transaction-isolation">,
+   <xref linkend="guc-transaction-read-only">, and
+   <xref linkend="guc-transaction-deferrable">.  Setting one of these
+   parameters acts the same as the corresponding <command>SET
+   TRANSACTION</command> option, with the same restrictions on when it can
+   be done.  However, these parameters cannot be set in the configuration
+   file, or from any source other than live SQL.
+  </para>
  </refsect1>
 
  <refsect1>