Skip to main content
Version: 2.x

pg_stat_progress_copy

The pg_stat_progress_copy view displays the progress of currently running COPY commands. Each row represents a backend process executing a COPY operation and provides details such as the command type (COPY FROM or COPY TO), I/O type (for example, FILE and PIPE), number of bytes and tuples processed, and counts of tuples excluded or skipped due to errors. This view is useful for monitoring long-running COPY operations.

ColumnTypeDescription
gp_segment_idintegerUnique identifier of a segment (or coordinator) instance. (This column is not present in the gp_stat_progress_copy_summary view.)
pidintegerProcess identifier of the backend, or the coordinator process identifier if the gp_stat_progress_copy_summary view.
datidoidThe object identifier of the database to which this backend is connected.
datnamenameName of the database to which this backend is connected.
relidoidThe object identifier of the table on which the COPY command is executed. It is set to 0 if copying from a SELECT query.
commandtextThe command that is running: COPY FROM, COPY TO, COPY FROM ON SEGMENT, or COPY TO ON SEGMENT.
typetextThe 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).
bytes_processedbigintNumber of bytes already processed by COPY command.
bytes_totalbigintSize of source file for COPY FROM command in bytes. It is set to 0 if not available.
tuples_processedbigintNumber of tuples already processed by COPY command.
tuples_excludedbigintNumber of tuples not processed because they were excluded by the WHERE clause of the COPY command.