> I have not found any tests for progress reporting. Are there any? It would > need two backends running (one running COPY, one checking output of report > view). Is there any similar test I can inspire at? In theory, it should be > possible to use dblink_send_query to run async COPY command in the > background.
We don't have any tests in core. I think that making deterministic test cases is rather tricky here as long as we don't have a more advanced testing framework that allows is to lock certain code paths and keep around an expected state until a second session comes around and looks at the progress catalog (even that would need adding more code to core to mark the extra point looked at). So I think that it is fine to not focus on that for this feature. The important parts are the choice of the progress points and the data sent to MyProc, and both should be chosen wisely.
Thanks for the info. I'm focusing exactly at looking for right spots to report the progress. I'll attach new patch with better places and supporting more options of reporting (including STDIN, STDOUT) soon and also I'll try to add it to commitfest.
> My initial (attached) patch also doesn't introduce documentation for this > system view. I can add that later once this patch is finalized (if that > happens).
You may want to add it to the next commit fest: https://commitfest.postgresql.org/28/ Documentation is necessary, and having some would ease reviews. -- Michael