From: | Josef Šimánek <josef(dot)simanek(at)gmail(dot)com> |
---|---|
To: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Subject: | Re: [PATCH] Initial progress reporting for COPY command |
Date: | 2020-06-21 11:34:29 |
Message-ID: | CAFp7QwrcoxXNokBR1d9O=uM3QdH=W3cxhYxNEtkVufeUd1nONw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
po 15. 6. 2020 v 7:34 odesílatel Bharath Rupireddy <
bharath(dot)rupireddyforpostgres(at)gmail(dot)com> napsal:
> > 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.
>
Thanks for suggestion. I used this approach and latest patch supports both
STDIN and STDOUT now.
> With Regards,
> Bharath Rupireddy.
> EnterpriseDB: http://www.enterprisedb.com
>
From | Date | Subject | |
---|---|---|---|
Next Message | Josef Šimánek | 2020-06-21 11:40:34 | Re: [PATCH] Initial progress reporting for COPY command |
Previous Message | Josef Šimánek | 2020-06-21 11:33:46 | Re: [PATCH] Initial progress reporting for COPY command |