> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/reference/sql-commands/sql-start-transaction.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# START TRANSACTION

### START TRANSACTION

START TRANSACTION — 開始一個交易區塊

### 語法

```

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
```

### 說明

本指令會開始一個新的交易區塊。若指定了隔離等級、讀寫模式， 或 deferrable 模式，新交易就會具備這些特性，如同執行了 [`SET TRANSACTION`](https://docs.postgresql.tw/19/reference/sql-commands/sql-set-transaction.md) 一般。這與 [`BEGIN`](https://docs.postgresql.tw/19/reference/sql-commands/sql-begin.md) 指令的效果相同。

### 參數

關於本陳述式各參數的意義，請參閱 [SET TRANSACTION](https://docs.postgresql.tw/19/reference/sql-commands/sql-set-transaction.md)。

### 相容性

在標準中，開始一個交易區塊並不需要發出 `START TRANSACTION`： 任何 SQL 指令都會隱含地開始一個區塊。PostgreSQL 的行為可以看作是在每個未接續在 `START TRANSACTION` （或 `BEGIN`）之後的指令執行完畢後，隱含地發出一次 `COMMIT`，因此常被稱為「自動提交（autocommit）」。 其他關聯式資料庫系統也可能提供自動提交功能，以求方便。

`DEFERRABLE` *`transaction_mode`* 是 PostgreSQL 的語言擴充功能。

SQL 標準要求在連續的 *`transaction_modes`* 之間使用逗號， 但基於歷史因素，PostgreSQL 允許省略逗號。

另請參閱 [SET TRANSACTION](https://docs.postgresql.tw/19/reference/sql-commands/sql-set-transaction.md) 的相容性一節。

### 參見

[BEGIN](https://docs.postgresql.tw/19/reference/sql-commands/sql-begin.md), [COMMIT](https://docs.postgresql.tw/19/reference/sql-commands/sql-commit.md), [ROLLBACK](https://docs.postgresql.tw/19/reference/sql-commands/sql-rollback.md), [SAVEPOINT](https://docs.postgresql.tw/19/reference/sql-commands/sql-savepoint.md), [SET TRANSACTION](https://docs.postgresql.tw/19/reference/sql-commands/sql-set-transaction.md)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/sql-start-transaction.html)（原文版本：18.6；核對日期：2026-09-28）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/reference/sql-commands/sql-start-transaction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
