Hi Antonin, The dummy command works: with v06-0001 alone, case 2 keeps the COPY's row. But with 0002 applied as well it is still lost, the same as on v05 and master. Tested on master 9ebc9a458c3.
> v06 fixes this too (hopefully it doesn't break the previous fixes). The script from my last mail gives 1, 1 and 1 rows in pg_stat_progress_copy with v06-0001 alone, but 1, 0 and 0 with 0001 and 0002, as before. With two file_fdw scans in the trigger's query, fileBeginForeignScan() turns pgstat_track_progress off, so neither inner COPY is pushed. But fileEndForeignScan() turns it back on before EndCopyFrom(), so the first inner COPY's pgstat_progress_end_command() runs, finds no parent and ends the outer COPY. Resuming after EndCopyFrom() would avoid that, but since 0001 now keeps the outer row by itself here, maybe 0002 can rely on the dummy command too. The previous fixes hold: the other deterministic cases give the same output as on v05, and nothing crashed or failed an assertion. Regards, Manu
