START TRANSACTION

|  START TRANSACTION  |                       |            |                  |                          |
|:-------------------:|-----------------------|------------|------------------|--------------------------|
|[Prev](sql-show.html)|[Up](sql-commands.html)|SQL Commands|[Home](index.html)| [Next](sql-truncate.html)|

---

[]()

## START TRANSACTION

START TRANSACTION — start a transaction block

## Synopsis

```
START TRANSACTION [ transaction_mode [, ...] ]

where transaction_mode is one of:

    ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
    READ WRITE | READ ONLY
    [ NOT ] DEFERRABLE

```

## Description

 This command begins a new transaction block. If the isolation level, read/write mode, or deferrable mode is specified, the new transaction has those characteristics, as if [`SET TRANSACTION`](sql-set-transaction.html) was executed. This is the same as the [`BEGIN`](sql-begin.html) command.

## Parameters

 Refer to [SET TRANSACTION](sql-set-transaction.html) for information on the meaning of the parameters to this statement.

## Compatibility

 In the standard, it is not necessary to issue `START TRANSACTION` to start a transaction block: any SQL command implicitly begins a block. PostgreSQL's behavior can be seen as implicitly issuing a `COMMIT` after each command that does not follow `START TRANSACTION` (or `BEGIN`), and it is therefore often called “autocommit”. Other relational database systems might offer an autocommit feature as a convenience.

 The `DEFERRABLE` *`transaction_mode`* is a PostgreSQL language extension.

 The SQL standard requires commas between successive *`transaction_modes`*, but for historical reasons PostgreSQL allows the commas to be omitted.

 See also the compatibility section of [SET TRANSACTION](sql-set-transaction.html).

## See Also

[BEGIN](sql-begin.html), [COMMIT](sql-commit.html), [ROLLBACK](sql-rollback.html), [SAVEPOINT](sql-savepoint.html), [SET TRANSACTION](sql-set-transaction.html)

---

|[Prev](sql-show.html)|[Up](sql-commands.html)| [Next](sql-truncate.html)|
|:--------------------|:---------------------:|-------------------------:|
|        SHOW         |  [Home](index.html)   |         TRUNCATE         |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>