stat() on Windows might cause error if target file is larger than4GB - Mailing list pgsql-hackers

From Higuchi, Daisuke
Subject stat() on Windows might cause error if target file is larger than4GB
Date
Msg-id 1803D792815FC24D871C00D17AE95905CF5099@g01jpexmbkw24
Whole thread Raw
Responses Re: stat() on Windows might cause error if target file is largerthan 4GB
List pgsql-hackers
Hi, 

This mail is about following bug report post: 
https://www.postgresql.org/message-id/flat/153442391458.1505.9181095584291689853%40wrigleys.postgresql.org

When pg_dump has '--format=directory' option and the dump file size become 
4GB over, the strange error message 'Unknown error' will be output. 

This is because _stat64i32() is used for stat() on Windows, I think. 
Seeing following URL, _stat64i32() could use 32 bit, it means 4GB is max size. 
https://msdn.microsoft.com/en-us/library/14h5k7ff.aspx

When I create the simple application to use stat() on VS2013, 
stat() could not deal with 4GB file and failed with errno=132.
I think the pg_dump occurs EOVERFLOW, but Windows' errno.h does not have 
this errno, so 'Unknown error' is output. 

So, pgwin32_safestat() should be changed to solve this problem. 
Do you have any idea or comments?

Regards, 
Daisuke Higuchi




pgsql-hackers by date:

Previous
From: Hironobu SUZUKI
Date:
Subject: Re: pgbench - add pseudo-random permutation function
Next
From: Tom Lane
Date:
Subject: SerializeParamList vs machines with strict alignment