On Tue, Jun 18, 2019 at 10:02:53AM +0000, PG Bug reporting form wrote:
> Issue using copy from command for files over 4GB.
>
> ERROR: could not stat file "E:\file.txt": Unknown error
> SQL state: XX000
Windows is known for having limitations in its former implementations
of stat(), and the various _stat structures they use make actually
that much harder from a compatibility point of view:
https://www.postgresql.org/message-id/1803D792815FC24D871C00D17AE95905CF5099@g01jpexmbkw24
Nobody has actually dug enough into this set of issues to get a patch
out of the ground, which basically requires more tweaks that one may
think at first sight (look at pgwin32_safestat() in src/port/dirmod.c
for example).
--
Michael