PROGRESS REPORT进度视图
pg_stat_progress_copy
每个正在运行COPY的后端一行,显示当前进度。请参阅Section 27.4.6。
进度视图 引入 14 现存至 20 devel 1 次结构变更
版本轨迹
相对 PostgreSQL 17 无变化。
当COPY正在运行时,pg_stat_progress_copy视图会为每个当前正在执行COPY命令的后端包含一行。下表描述了会报告哪些信息,以及应如何解释这些信息。
字段
PostgreSQL 18 的 11 个字段,按定义顺序排列。说明默认用本站手册的译文,没有译文的按英文原文显示。
| 字段 | 类型 | 说明 |
|---|---|---|
pid
|
integer
|
后端的进程ID。 |
datid
|
oid
|
后端连接到的数据库的OID。 |
datname
|
name
|
后端连接到的数据库的名称。 |
relid
|
oid
|
执行COPY命令的表的OID。 如果从SELECT查询中复制,它被设置为0。 |
command
|
text
|
正在运行的命令: COPY FROM, 或 COPY TO。 |
type
|
text
|
数据被读取或写入的io类型:FILE, PROGRAM, PIPE (对于COPY FROM STDIN 和 COPY TO STDOUT),或 CALLBACK(例如在逻辑复制中初始表同步期间使用)。 |
bytes_processed
|
bigint
|
已经被COPY命令处理的字节数。 |
bytes_total
|
bigint
|
COPY FROM命令的源文件大小,以字节计。 如果不可用则设置为0。 |
tuples_processed
|
bigint
|
已经被COPY命令处理的元组数。 |
tuples_excluded
|
bigint
|
没有处理的元组数,因为它们被COPY命令的WHERE子句所排除。 |
tuples_skipped
|
bigint
|
因包含格式错误的数据而被跳过的元组数。只有当 ON_ERROR 选项指定的值不是 stop 时,此计数器才会递增。 |
演化历史
相邻两个大版本之间的差异,新的在前。版本号链到该版的字段表。
-
PostgreSQL 19 ← 18 仅描述更新
1 处描述更新
tuples_skippedNumber of tuples skipped because they contain malformed data. This counter only advances when a value other than stop is specified to the ON_ERROR option. Number of tuples skipped because they contain malformed data. This counter only advances when ignore is specified to the ON_ERROR option.
-
PostgreSQL 17 ← 16 结构变更
tuples_skipped1 处描述更新
typeThe io type that the data is read from or written to: FILE, PROGRAM, PIPE (for COPY FROM STDIN and COPY TO STDOUT), or CALLBACK (used for example during the initial table synchronization in logical replication). The I/O type that the data is read from or written to: FILE, PROGRAM, PIPE (for COPY FROM STDIN and COPY TO STDOUT), or CALLBACK (used for example during the initial table synchronization in logical replication).
-
PostgreSQL 14 ← 13 新增此关系
共 10 个字段
字段矩阵
每个字段在 7 个收录版本里的存在情况;方格指向该版的字段表。「有变」指类型、可空、隐式或数组维数与上一版不同。
存在 有变 已移除 不存在
| 字段 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|
pid |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
datid |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
datname |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
relid |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
command |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
type |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
bytes_processed |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
bytes_total |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
tuples_processed |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
tuples_excluded |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
tuples_skipped |
不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 |
同类关系
| 关系 | 引入 | 字段 | 版本变动 | 最近变更 |
|---|---|---|---|---|
pg_stat_progress_analyze |
13 | 14 | 192 次 | |
| 每个正在运行ANALYZE的后端(包括自动清理工作进程)一行,显示当前进度。请参阅Section 27.4.1。 | 现存 | |||
pg_stat_progress_basebackup |
13 | 7 | 191 次 | |
| 每个正在流式传输基础备份的 WAL 发送进程一行,显示当前进度。请参阅Section 27.4.5。 | 现存 | |||
pg_stat_progress_cluster |
12 | 12 | — | |
| 每个正在运行CLUSTER或VACUUM FULL的后端一行,显示当前进度。请参阅Section 27.4.4。 | 现存 | |||
pg_stat_progress_copy |
14 | 11 | 171 次 | |
| 每个正在运行COPY的后端一行,显示当前进度。请参阅Section 27.4.6。 | 现存 | |||
pg_stat_progress_create_index |
12 | 16 | — | |
| 每个正在运行CREATE INDEX或REINDEX的后端一行,显示当前进度。请参阅Section 27.4.2。 | 现存 | |||
pg_stat_progress_data_checksums |
19 | 10 | — | |
| 启用或禁用数据校验和时,数据校验和启动器进程占一行。启用数据校验和时, 该视图还会为每个工作进程提供一行,显示当前进度。 详见Section 27.4.8。 | 现存 | |||
pg_stat_progress_repack |
19 | 14 | — | |
| 每个正在运行REPACK、CLUSTER或VACUUM FULL的后端一行,显示当前进度。请参阅Section 27.4.3。 | 现存 | |||
pg_stat_progress_vacuum |
9.6 | 17 | 193 次 | |
| 每个正在运行VACUUM的后端(包括自动清理工作进程)一行,显示当前进度。请参阅Section 27.4.3。 | 现存 | |||