Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/backend/commands/copyfromparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ CopyGetData(CopyFromState cstate, void *databuf, int minread, int maxread)
switch (cstate->copy_src)
{
case COPY_FILE:
pgstat_report_wait_start(WAIT_EVENT_COPY_DATA_READ);
bytesread = fread(databuf, 1, maxread, cstate->copy_file);
pgstat_report_wait_end();
if (ferror(cstate->copy_file))
ereport(ERROR,
(errcode_for_file_access(),
Expand Down
2 changes: 2 additions & 0 deletions src/backend/commands/copyto.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ CopySendEndOfRow(CopyToState cstate)
switch (cstate->copy_dest)
{
case COPY_FILE:
pgstat_report_wait_start(WAIT_EVENT_COPY_DATA_WRITE);
if (fwrite(fe_msgbuf->data, fe_msgbuf->len, 1,
cstate->copy_file) != 1 ||
ferror(cstate->copy_file))
Expand Down Expand Up @@ -486,6 +487,7 @@ CopySendEndOfRow(CopyToState cstate)
(errcode_for_file_access(),
errmsg("could not write to COPY file: %m")));
}
pgstat_report_wait_end();
break;
case COPY_FRONTEND:
/* Dump the accumulated row as one CopyData message */
Expand Down
2 changes: 2 additions & 0 deletions src/backend/utils/activity/wait_event_names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ CONTROL_FILE_SYNC "Waiting for the <filename>pg_control</filename> file to reach
CONTROL_FILE_SYNC_UPDATE "Waiting for an update to the <filename>pg_control</filename> file to reach durable storage."
CONTROL_FILE_WRITE "Waiting for a write to the <filename>pg_control</filename> file."
CONTROL_FILE_WRITE_UPDATE "Waiting for a write to update the <filename>pg_control</filename> file."
COPY_DATA_READ "Waiting for a read from a file or program during COPY FROM."
COPY_DATA_WRITE "Waiting for a write to a file or program during COPY TO."
COPY_FILE_COPY "Waiting for a file copy operation."
COPY_FILE_READ "Waiting for a read during a file copy operation."
COPY_FILE_WRITE "Waiting for a write during a file copy operation."
Expand Down