Re: [PATCH] Initial progress reporting for COPY command

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: [PATCH] Initial progress reporting for COPY command
Дата
Msg-id CALj2ACUnPKtKTgL9BmvT0FjFR5UTUA46pbyRDsq0wu_AkFRh+w@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Initial progress reporting for COPY command  (Josef Šimánek <josef.simanek@gmail.com>)
Ответы Re: [PATCH] Initial progress reporting for COPY command  (Josef Šimánek <josef.simanek@gmail.com>)
Список pgsql-hackers
> I'm using ftell to get current position in file to populate file_bytes_processed without error handling (ftell can
return-1L and also populate errno on problems).
 
>
> 1. Is that a good way to get progress of file processing?

IMO, it's better to handle the error cases. One possible case where
ftell can return -1 and set errno is when the total bytes processed is
more than LONG_MAX.

Will your patch handle file_bytes_processed reporting for COPY FROM
STDIN cases? For this case, ftell can't be used.

Instead of using ftell and worrying about the errors, a simple
approach could be to have a uint64 variable in CopyStateData to track
the number of bytes read whenever CopyGetData is called. This approach
can also handle the case of COPY FROM STDIN.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [POC] Fast COPY FROM command for the table with foreign partitions
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: hashagg slowdown due to spill changes