Re: [PATCH] Simple progress reporting for COPY command - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: [PATCH] Simple progress reporting for COPY command
Date
Msg-id CAEze2WieBKh61QL=r-3DQrcdH0KgAdZfL=QUhkzqyTgrxm6qKA@mail.gmail.com
Whole thread Raw
In response to [PATCH] Simple progress reporting for COPY command  (Josef Šimánek <josef.simanek@gmail.com>)
List pgsql-hackers
On Fri, 1 Jan 2021 at 02:25, Josef Šimánek <josef.simanek@gmail.com> wrote:
>
> Hello,
>
> finally I had some time to revisit patch and all comments from
> https://www.postgresql.org/message-id/CAFp7QwqMGEi4OyyaLEK9DR0%2BE%2BoK3UtA4bEjDVCa4bNkwUY2PQ%40mail.gmail.com
> and I have prepared simple version of COPY command progress reporting.

+1

> To keep the patch small as possible, I have introduced only a minimum
> set of columns. It could be extended later if needed.

Seems reasonable. One potential extention I could think of is progress reporting of tuples processed before/after applying the COPY's WHERE  clause, when and where applicable.

> Columns are inspired by CREATE INDEX progress report system view.
>
> pid - integer - PID of backend
> datid - oid - OID of related database
> datname - name - name of related database (this seems redundant, since
> oid should be enough, but it is the same in CREATE INDEX)
> relid - oid - oid of table related to COPY command, when not known
> (for example when copying to file, it is 0)
> bytes_processed - bigint - amount of bytes processed
> bytes_total - bigint - file size in bytes if COPY FROM file (0 if not
> COPY FROM file)
> lines_processed - bigint - amount of tuples processed

Could you update the name of this column to be consistent with the 'tuples'-terminology used in the other progress reporting views, i.e. lines_processed -> tuples_processed? That adds consistency, and also disambiguates the meaning in case of e.g. COPY FROM (format CSV), as multiline CSV fields do exist, and we're not necessarily counting lines from or to a file.



With regards,


Matthias van de Meent

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Context diffs
Next
From: Michael Paquier
Date:
Subject: Re: doc review for v14