> 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/server-administration/monitoring/progress-reporting/copy-progress-reporting.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 27.4.3. COPY 進度回報

## 27.4.3. COPY 進度回報 [#](#copy-progress-reporting) <a href="#copy-progress-reporting" id="copy-progress-reporting"></a>

每當 `COPY` 正在執行時， `pg_stat_progress_copy` 檢視表中， 就會針對每個目前正在執行 `COPY` 命令的後端， 各含有一列。下方的表格， 說明了會被回報的資訊，並提供如何解讀這些資訊的說明。

### 表 27.42. `pg_stat_progress_copy` 檢視表 [#](#pg-stat-progress-copy-view) <a href="#pg-stat-progress-copy-view" id="pg-stat-progress-copy-view"></a>

| <p>欄位型別</p><p>說明</p>                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>pid</code> <code>integer</code></p><p>後端程序的 ID。</p>                                                                                                                                                                                |
| <p><code>datid</code> <code>oid</code></p><p>此後端所連線之資料庫的 OID。</p>                                                                                                                                                                           |
| <p><code>datname</code> <code>name</code></p><p>此後端所連線之資料庫的名稱。</p>                                                                                                                                                                          |
| <p><code>relid</code> <code>oid</code></p><p>正在對其執行 <code>COPY</code> 命令之資料表的 OID。此值設為 <code>0</code>，適用於複製來源為 <code>SELECT</code> 查詢的情況。</p>                                                                                               |
| <p><code>command</code> <code>text</code></p><p>目前正在執行的命令：<code>COPY FROM</code>， 或 <code>COPY TO</code>。</p>                                                                                                                               |
| <p><code>type</code> <code>text</code></p><p>讀取或寫入資料所使用的 I/O 類型： <code>FILE</code>、<code>PROGRAM</code>、 <code>PIPE</code>（用於 <code>COPY FROM STDIN</code> 與 <code>COPY TO STDOUT</code>）， 或 <code>CALLBACK</code> （例如用於邏輯複寫中初始資料表同步時）。</p> |
| <p><code>bytes\_processed</code> <code>bigint</code></p><p><code>COPY</code> 命令已處理的位元組數。</p>                                                                                                                                                |
| <p><code>bytes\_total</code> <code>bigint</code></p><p><code>COPY FROM</code> 命令來源檔案的大小， 以位元組表示。若無法取得，則設為 <code>0</code>。</p>                                                                                                               |
| <p><code>tuples\_processed</code> <code>bigint</code></p><p><code>COPY</code> 命令已處理的資料列數量。</p>                                                                                                                                              |
| <p><code>tuples\_excluded</code> <code>bigint</code></p><p>因被 <code>WHERE</code> 子句（此子句屬於 <code>COPY</code> 命令）排除，而未被處理的 資料列數量。</p>                                                                                                         |
| <p><code>tuples\_skipped</code> <code>bigint</code></p><p>因含有格式錯誤的資料而被略過的資料列數量。 此計數器只會在 非 <code>stop</code> 的值被指定給 <code>ON\_ERROR</code> 選項時才會前進。</p>                                                                                      |

<br>

[返回 27.4. 進度回報](https://docs.postgresql.tw/19/server-administration/monitoring/progress-reporting.md#progress-reporting)

***

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


---

# 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/server-administration/monitoring/progress-reporting/copy-progress-reporting.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.
