> 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/the-sql-language/functions/functions-info/functions-info-commit-timestamp.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 9.27.9. 已提交交易資訊函式

## 9.27.9. 已提交交易資訊函式 [#](#functions-info-commit-timestamp) <a href="#functions-info-commit-timestamp" id="functions-info-commit-timestamp"></a>

[表 9.87](#functions-commit-timestamp) 所列的函式提供過去的交易是在何時提交的資訊。只有在啟用了 [track\_commit\_timestamp](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-replication.md#GUC-TRACK-COMMIT-TIMESTAMP) 組態選項時，它們才會提供有用的資料，而且只適用於啟用該選項之後才提交的交易。提交時間戳記資訊會在 vacuum 期間例行性地移除。

### 表 9.87. 已提交交易資訊函式 [#](#functions-commit-timestamp) <a href="#functions-commit-timestamp" id="functions-commit-timestamp"></a>

| <p>函式</p><p>說明</p>                                                                                                                                                                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>pg\_xact\_commit\_timestamp</code> ( <code>xid</code> ) → <code>timestamp with time zone</code></p><p>回傳交易的提交時間戳記。</p>                                                                                                                                                   |
| <p><code>pg\_xact\_commit\_timestamp\_origin</code> ( <code>xid</code> ) → <code>record</code> ( <em><code>timestamp</code></em> <code>timestamp with time zone</code>, <em><code>roident</code></em> <code>oid</code>)</p><p>回傳交易的提交時間戳記與複寫來源（replication origin）。</p>           |
| <p><code>pg\_last\_committed\_xact</code> () → <code>record</code> ( <em><code>xid</code></em> <code>xid</code>, <em><code>timestamp</code></em> <code>timestamp with time zone</code>, <em><code>roident</code></em> <code>oid</code> )</p><p>回傳最近一個已提交交易的交易 ID、提交時間戳記與複寫來源。</p> |

<br>

[返回 9.27. 系統資訊函式與運算子](https://docs.postgresql.tw/19/the-sql-language/functions/functions-info.md#functions-info)

***

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


---

# 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/the-sql-language/functions/functions-info/functions-info-commit-timestamp.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.
