Skip to content

Commit bb9bead

Browse files
committed
Doc: document the current-transaction-modes GUCs.
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
1 parent 5992c94 commit bb9bead

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

doc/src/sgml/config.sgml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7777,6 +7777,68 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
77777777
</listitem>
77787778
</varlistentry>
77797779

7780+
<varlistentry id="guc-transaction-isolation" xreflabel="transaction_isolation">
7781+
<term><varname>transaction_isolation</varname> (<type>enum</type>)
7782+
<indexterm>
7783+
<primary>transaction isolation level</primary>
7784+
</indexterm>
7785+
<indexterm>
7786+
<primary><varname>transaction_isolation</varname> configuration parameter</primary>
7787+
</indexterm>
7788+
</term>
7789+
<listitem>
7790+
<para>
7791+
This parameter reflects the current transaction's isolation level.
7792+
At the beginning of each transaction, it is set to the current value
7793+
of <xref linkend="guc-default-transaction-isolation"/>.
7794+
Any subsequent attempt to change it is equivalent to a <xref
7795+
linkend="sql-set-transaction"/> command.
7796+
</para>
7797+
</listitem>
7798+
</varlistentry>
7799+
7800+
<varlistentry id="guc-transaction-read-only" xreflabel="transaction_read_only">
7801+
<term><varname>transaction_read_only</varname> (<type>boolean</type>)
7802+
<indexterm>
7803+
<primary>read-only transaction</primary>
7804+
<secondary>setting default</secondary>
7805+
</indexterm>
7806+
<indexterm>
7807+
<primary><varname>transaction_read_only</varname> configuration parameter</primary>
7808+
</indexterm>
7809+
</term>
7810+
<listitem>
7811+
<para>
7812+
This parameter reflects the current transaction's read-only status.
7813+
At the beginning of each transaction, it is set to the current value
7814+
of <xref linkend="guc-default-transaction-read-only"/>.
7815+
Any subsequent attempt to change it is equivalent to a <xref
7816+
linkend="sql-set-transaction"/> command.
7817+
</para>
7818+
</listitem>
7819+
</varlistentry>
7820+
7821+
<varlistentry id="guc-transaction-deferrable" xreflabel="transaction_deferrable">
7822+
<term><varname>transaction_deferrable</varname> (<type>boolean</type>)
7823+
<indexterm>
7824+
<primary>deferrable transaction</primary>
7825+
<secondary>setting default</secondary>
7826+
</indexterm>
7827+
<indexterm>
7828+
<primary><varname>transaction_deferrable</varname> configuration parameter</primary>
7829+
</indexterm>
7830+
</term>
7831+
<listitem>
7832+
<para>
7833+
This parameter reflects the current transaction's deferrability status.
7834+
At the beginning of each transaction, it is set to the current value
7835+
of <xref linkend="guc-default-transaction-deferrable"/>.
7836+
Any subsequent attempt to change it is equivalent to a <xref
7837+
linkend="sql-set-transaction"/> command.
7838+
</para>
7839+
</listitem>
7840+
</varlistentry>
7841+
77807842

77817843
<varlistentry id="guc-session-replication-role" xreflabel="session_replication_role">
77827844
<term><varname>session_replication_role</varname> (<type>enum</type>)

doc/src/sgml/ref/set_transaction.sgml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
202202
</para>
203203

204204
<para>
205-
The session default transaction modes can also be set by setting the
205+
The session default transaction modes can also be set or examined via the
206206
configuration parameters <xref linkend="guc-default-transaction-isolation"/>,
207207
<xref linkend="guc-default-transaction-read-only"/>, and
208208
<xref linkend="guc-default-transaction-deferrable"/>.
@@ -212,6 +212,17 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
212212
<command>ALTER DATABASE</command>, etc. Consult <xref linkend="runtime-config"/>
213213
for more information.
214214
</para>
215+
216+
<para>
217+
The current transaction's modes can similarly be set or examined via the
218+
configuration parameters <xref linkend="guc-transaction-isolation"/>,
219+
<xref linkend="guc-transaction-read-only"/>, and
220+
<xref linkend="guc-transaction-deferrable"/>. Setting one of these
221+
parameters acts the same as the corresponding <command>SET
222+
TRANSACTION</command> option, with the same restrictions on when it can
223+
be done. However, these parameters cannot be set in the configuration
224+
file, or from any source other than live SQL.
225+
</para>
215226
</refsect1>
216227

217228
<refsect1>

0 commit comments

Comments
 (0)