mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Issue error on SET outside transaction block in some cases
Issue error for SET LOCAL/CONSTRAINTS/TRANSACTION outside a transaction block, as they have no effect. Per suggestion from Morten Hustveit
This commit is contained in:
@ -110,10 +110,9 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</rep
|
||||
<para>
|
||||
Specifies that the command takes effect for only the current
|
||||
transaction. After <command>COMMIT</> or <command>ROLLBACK</>,
|
||||
the session-level setting takes effect again. Note that
|
||||
<command>SET LOCAL</> will appear to have no effect if it is
|
||||
executed outside a <command>BEGIN</> block, since the
|
||||
transaction will end immediately.
|
||||
the session-level setting takes effect again.
|
||||
<productname>PostgreSQL</productname> reports an error if
|
||||
<command>SET LOCAL</> is used outside a transaction block.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -102,7 +102,7 @@ SET CONSTRAINTS { ALL | <replaceable class="parameter">name</replaceable> [, ...
|
||||
current transaction. Thus, if you execute this command outside of a
|
||||
transaction block
|
||||
(<command>BEGIN</command>/<command>COMMIT</command> pair), it will
|
||||
not appear to have any effect.
|
||||
generate an error.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -184,9 +184,8 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa
|
||||
|
||||
<para>
|
||||
If <command>SET TRANSACTION</command> is executed without a prior
|
||||
<command>START TRANSACTION</command> or <command>BEGIN</command>,
|
||||
it will appear to have no effect, since the transaction will immediately
|
||||
end.
|
||||
<command>START TRANSACTION</command> or <command>BEGIN</command>,
|
||||
it will generate an error.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
Reference in New Issue
Block a user