pg_stat_progress_copy

A progress reporting view providing information on the progress of COPY execution
This entry relates to a PostgreSQL feature which is part of PostgreSQL 14, due to be released in late 2021.

pg_stat_progress_copy is a progress reporting view providing information on the progress of COPY command execution.

pg_stat_progress_copy was added in PostgreSQL 14.

Definition by PostgreSQL version

pg_stat_progress_copy (PostgreSQL 15)

           View "pg_catalog.pg_stat_progress_copy"
      Column      |  Type   | Collation | Nullable | Default 
------------------+---------+-----------+----------+---------
 pid              | integer |           |          | 
 datid            | oid     |           |          | 
 datname          | name    |           |          | 
 relid            | oid     |           |          | 
 command          | text    |           |          | 
 type             | text    |           |          | 
 bytes_processed  | bigint  |           |          | 
 bytes_total      | bigint  |           |          | 
 tuples_processed | bigint  |           |          | 
 tuples_excluded  | bigint  |           |          |
    

Documentation: pg_stat_progress_copy

pg_stat_progress_copy (PostgreSQL 14)

           View "pg_catalog.pg_stat_progress_copy"
      Column      |  Type   | Collation | Nullable | Default 
------------------+---------+-----------+----------+---------
 pid              | integer |           |          | 
 datid            | oid     |           |          | 
 datname          | name    |           |          | 
 relid            | oid     |           |          | 
 command          | text    |           |          | 
 type             | text    |           |          | 
 bytes_processed  | bigint  |           |          | 
 bytes_total      | bigint  |           |          | 
 tuples_processed | bigint  |           |          | 
 tuples_excluded  | bigint  |           |          |
    

Documentation: pg_stat_progress_copy

Change history

Examples

Sample output during a COPY FROM operation:

postgres=# SELECT * FROM pg_stat_progress_copy\gx
-[ RECORD 1 ]----+----------
pid              | 1708412
datid            | 13968
datname          | postgres
relid            | 16473
command          | COPY FROM
type             | PIPE
bytes_processed  | 496156582
bytes_total      | 0
tuples_processed | 522864
tuples_excluded  | 0

Categories

Progress reporting view

See also

COPY