Re: stat() on Windows might cause error if target file is larger than 4GB

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>, "Higuchi, Daisuke" <higuchi(dot)daisuke(at)jp(dot)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: stat() on Windows might cause error if target file is larger than 4GB
Date: 2020-05-09 08:51:36
Message-ID: CAC+AXB06Q=cYevL1m8goMEtDBSC-_-wHG92vTVDmAHR2bxXqWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 9, 2020 at 2:49 AM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> On 2018-Sep-13, Tom Lane wrote:
>
> > What I was vaguely imagining is that win32_port.h could #include
> > whichever Windows header defines these functions and structs, and
> > then do
> >
> > #define stat __stat64
> >
> > static inline ... __stat64(...) { return _stat64(...); }
> >
> > What would need testing is whether the #define has nasty side-effects
> > even if we've already included the system header. I don't think it'd
> > hurt, eg, local variables named "stat"; though people might be surprised
> > when examining things in a debugger.
>
> Did anybody test this idea? It seems we let this problem slip unfixed,
> which means Windows users cannot use pg_dump -Fd (incl. parallel dump)
> when output files are large.
>

This issue gets reported from time to time as bug, it also affects COPY.
There is an open item for so:

https://commitfest.postgresql.org/28/2189/

Regards,

Juan José Santamaría Flecha

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-05-09 08:57:01 Re: Logical replication subscription owner
Previous Message Michael Paquier 2020-05-09 08:48:07 Re: Strange decreasing value of pg_last_wal_receive_lsn()