Skip to content

Commit 3058732

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 ccfc3cb commit 3058732

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
@@ -6895,6 +6895,68 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
68956895
</listitem>
68966896
</varlistentry>
68976897

6898+
<varlistentry id="guc-transaction-isolation" xreflabel="transaction_isolation">
6899+
<term><varname>transaction_isolation</varname> (<type>enum</type>)
6900+
<indexterm>
6901+
<primary>transaction isolation level</primary>
6902+
</indexterm>
6903+
<indexterm>
6904+
<primary><varname>transaction_isolation</varname> configuration parameter</primary>
6905+
</indexterm>
6906+
</term>
6907+
<listitem>
6908+
<para>
6909+
This parameter reflects the current transaction's isolation level.
6910+
At the beginning of each transaction, it is set to the current value
6911+
of <xref linkend="guc-default-transaction-isolation"/>.
6912+
Any subsequent attempt to change it is equivalent to a <xref
6913+
linkend="sql-set-transaction"/> command.
6914+
</para>
6915+
</listitem>
6916+
</varlistentry>
6917+
6918+
<varlistentry id="guc-transaction-read-only" xreflabel="transaction_read_only">
6919+
<term><varname>transaction_read_only</varname> (<type>boolean</type>)
6920+
<indexterm>
6921+
<primary>read-only transaction</primary>
6922+
<secondary>setting default</secondary>
6923+
</indexterm>
6924+
<indexterm>
6925+
<primary><varname>transaction_read_only</varname> configuration parameter</primary>
6926+
</indexterm>
6927+
</term>
6928+
<listitem>
6929+
<para>
6930+
This parameter reflects the current transaction's read-only status.
6931+
At the beginning of each transaction, it is set to the current value
6932+
of <xref linkend="guc-default-transaction-read-only"/>.
6933+
Any subsequent attempt to change it is equivalent to a <xref
6934+
linkend="sql-set-transaction"/> command.
6935+
</para>
6936+
</listitem>
6937+
</varlistentry>
6938+
6939+
<varlistentry id="guc-transaction-deferrable" xreflabel="transaction_deferrable">
6940+
<term><varname>transaction_deferrable</varname> (<type>boolean</type>)
6941+
<indexterm>
6942+
<primary>deferrable transaction</primary>
6943+
<secondary>setting default</secondary>
6944+
</indexterm>
6945+
<indexterm>
6946+
<primary><varname>transaction_deferrable</varname> configuration parameter</primary>
6947+
</indexterm>
6948+
</term>
6949+
<listitem>
6950+
<para>
6951+
This parameter reflects the current transaction's deferrability status.
6952+
At the beginning of each transaction, it is set to the current value
6953+
of <xref linkend="guc-default-transaction-deferrable"/>.
6954+
Any subsequent attempt to change it is equivalent to a <xref
6955+
linkend="sql-set-transaction"/> command.
6956+
</para>
6957+
</listitem>
6958+
</varlistentry>
6959+
68986960

68996961
<varlistentry id="guc-session-replication-role" xreflabel="session_replication_role">
69006962
<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)