> 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/client-interfaces/information-schema/infoschema-triggers.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 35.57. triggers \#

### 35.57. `triggers` [#](#infoschema-triggers) <a href="#infoschema-triggers" id="infoschema-triggers"></a>

檢視表 `triggers` 包含目前資料庫中，定義在目前使用者所擁有、或具有 `SELECT` 以外某項權限之資料表與檢視表上的所有觸發程序。

#### 表 35.55. `triggers` 欄位 [#](#infoschema-triggers-columns) <a href="#infoschema-triggers-columns" id="infoschema-triggers-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>trigger\_catalog</code> <code>sql\_identifier</code></p><p>包含觸發程序的資料庫名稱（一律為目前資料庫）</p>                                                                                                                                            |
| <p><code>trigger\_schema</code> <code>sql\_identifier</code></p><p>包含觸發程序的綱要名稱</p>                                                                                                                                                        |
| <p><code>trigger\_name</code> <code>sql\_identifier</code></p><p>觸發程序名稱</p>                                                                                                                                                               |
| <p><code>event\_manipulation</code> <code>character\_data</code></p><p>引發此觸發程序的事件（<code>INSERT</code>、 <code>UPDATE</code> 或 <code>DELETE</code>）</p>                                                                                     |
| <p><code>event\_object\_catalog</code> <code>sql\_identifier</code></p><p>包含定義此觸發程序之資料表的資料庫名稱（一律為目前資料庫）</p>                                                                                                                               |
| <p><code>event\_object\_schema</code> <code>sql\_identifier</code></p><p>包含定義此觸發程序之資料表的綱要名稱</p>                                                                                                                                           |
| <p><code>event\_object\_table</code> <code>sql\_identifier</code></p><p>定義此觸發程序的資料表名稱</p>                                                                                                                                                 |
| <p><code>action\_order</code> <code>cardinal\_number</code></p><p>同一資料表上具有相同 <code>event\_manipulation</code>、 <code>action\_timing</code> 與 <code>action\_orientation</code> 的觸發程序之間的觸發順序。在 PostgreSQL 中，觸發程序依名稱順序觸發， 因此此欄位反映的就是該順序。</p> |
| <p><code>action\_condition</code> <code>character\_data</code></p><p>觸發程序的 <code>WHEN</code> 條件；若無則為 null （若資料表並非由目前已啟用的角色擁有，也為 null）</p>                                                                                                 |
| <p><code>action\_statement</code> <code>character\_data</code></p><p>觸發程序所執行的陳述式（目前一律為 <code>EXECUTE FUNCTION </code><em><code>function</code></em><code>(...)</code>）</p>                                                                |
| <p><code>action\_orientation</code> <code>character\_data</code></p><p>表示觸發程序是對每個處理的資料列各觸發一次，還是對每個陳述式各觸發一次 （<code>ROW</code> 或 <code>STATEMENT</code>）</p>                                                                                |
| <p><code>action\_timing</code> <code>character\_data</code></p><p>觸發程序的觸發時機（<code>BEFORE</code>、 <code>AFTER</code> 或 <code>INSTEAD OF</code>）</p>                                                                                        |
| <p><code>action\_reference\_old\_table</code> <code>sql\_identifier</code></p><p>「old」轉換資料表的名稱；若無則為 null</p>                                                                                                                              |
| <p><code>action\_reference\_new\_table</code> <code>sql\_identifier</code></p><p>「new」轉換資料表的名稱；若無則為 null</p>                                                                                                                              |
| <p><code>action\_reference\_old\_row</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 未提供的功能</p>                                                                                                                                  |
| <p><code>action\_reference\_new\_row</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 未提供的功能</p>                                                                                                                                  |
| <p><code>created</code> <code>time\_stamp</code></p><p>適用於 PostgreSQL 未提供的功能</p>                                                                                                                                                          |

<br>

PostgreSQL 中的觸發程序與 SQL 標準有兩處不相容，會影響其在資訊綱要中的 呈現方式。第一，在 PostgreSQL 中，觸發程序名稱是各資料表的區域名稱，而不是 獨立的綱要物件。因此，只要分屬不同的資料表，同一綱要中就可以定義名稱重複的 觸發程序。（`trigger_catalog` 與 `trigger_schema` 實際上是與定義該觸發程序之資料表相關的值。）第二，在 PostgreSQL 中，觸發程序可以定義為在多個事件上觸發（例如 `ON INSERT OR UPDATE`），而 SQL 標準只允許一個事件。若觸發程序定義為在多個事件上觸發， 它在資訊綱要中會以多個資料列表示，每種事件型別各一列。由於這兩個問題， 檢視表 `triggers` 的主鍵實際上是 `(trigger_catalog, trigger_schema, event_object_table, trigger_name, event_manipulation)`，而不是 SQL 標準所規定的 `(trigger_catalog, trigger_schema, trigger_name)`。 儘管如此，若你以符合 SQL 標準的方式定義觸發程序（觸發程序名稱在綱要中唯一， 且每個觸發程序只有一種事件型別），就不會受到影響。

#### 注意

在 PostgreSQL 9.1 之前，此檢視表的欄位 `action_timing`、 `action_reference_old_table`、 `action_reference_new_table`、 `action_reference_old_row` 與 `action_reference_new_row` 分別命名為 `condition_timing`、 `condition_reference_old_table`、 `condition_reference_new_table`、 `condition_reference_old_row` 與 `condition_reference_new_row`。 這是它們在 SQL:1999 標準中的名稱；新的命名則符合 SQL:2003 及之後的標準。

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/infoschema-triggers.html)（原文版本：18.6；核對日期：2026-10-18）


---

# 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/client-interfaces/information-schema/infoschema-triggers.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.
