RefLib

Reference library for AI

Back

postgresql_16:7.1.176.2 Notes

PostgreSQL 16 > Reference > SQL Commands > SET TRANSACTION > Notes

If SET TRANSACTION is executed without a prior START TRANSACTION or BEGIN, it emits a warning and otherwise has no effect.

It is possible to dispense with SET TRANSACTION by instead specifying the desired *transaction_modes* in BEGIN or START TRANSACTION. But that option is not available for SET TRANSACTION SNAPSHOT.

The session default transaction modes can also be set or examined via the configuration parameters (see guc-default-transaction-isolation), (see guc-default-transaction-read-only), and (see guc-default-transaction-deferrable). (In fact SET SESSION CHARACTERISTICS is just a verbose equivalent for setting these variables with SET.) This means the defaults can be set in the configuration file, via ALTER DATABASE, etc. Consult (see postgresql_16:4.5) for more information.

The current transaction's modes can similarly be set or examined via the configuration parameters (see guc-transaction-isolation), (see guc-transaction-read-only), and (see guc-transaction-deferrable). Setting one of these parameters acts the same as the corresponding SET TRANSACTION 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.

Back