Concurrent transaction serialization and queueing, implicit transactions
An implicit transaction is a single SQL statement that is not framed by a BEGIN statement.
When an implicit transaction fails serialization
The system responds as follows for an
implicit transaction that fails serialization:
- The system waits for the completion of the transaction that caused the serialization conflict.
- After that transaction finishes, either by commit or abort, the system resubmits the waiting requests.
When the number of implicit transactions exceeds the limit
If the system reaches a limit of 63 concurrent read/write transactions and an implicit transaction is issued that attempts to modify data, the system saves and queues the transaction until the number of concurrent read/write transactions falls below the limit.
Modify the default time limit
The system saves and queues implicit transactions
for up to 360 minutes (the default). If an implicit transaction waits
for more than 360 minutes (or six hours), the transaction fails and
returns the error message ERROR: Too many concurrent transactions.
You can modify this default timeout setting in two ways:
- To set the value for the current session, issue the following
command:
SET serialization_queue_timeout = <number of minutes>
- To make the setting global, set the variable serialization_queue_timeout in postgresql.conf.