Re: Windows pg_basebackup unable to create >2GB pg_wal.tar tarballs ("could not close file: Invalid argument" when creating pg_wal.tar of size ~ 2^31 bytes)

Jakub Wartak <jakub.wartak@enterprisedb.com>

From: Jakub Wartak <jakub.wartak@enterprisedb.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Dilip Kumar <dilip.kumar@enterprisedb.com>
Date: 2025-01-09T09:28:05Z
Lists: pgsql-hackers
On Thu, Jan 9, 2025 at 4:12 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>
> On Tue, Jan 7, 2025 at 9:54 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> > On Tue, Jan 7, 2025 at 5:23 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> > > Do you have a plan for moving ahead with this?
> >
> > I think that all looks good, and I'll go ahead and commit it in the
> > next day or two.  Sorry for the delay.
>
> I changed some remaining off_t, because I don't want to worry about
> which ones can and can't overflow.  Might as we'll get 'em all.  I
> also noticed a warning due to the new lseek() macro, which just
> required adding it to plperl_system.h.
>
> And pushed.

Thank you very much, Thomas! (and best wishes in 2025)

-J.



Commits

  1. Fix off_t overflow in pg_basebackup on Windows.

  2. Provide 64-bit ftruncate() and lseek() on Windows.

  3. Require ucrt if using MinGW.