Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1HR4-0003Hg-OB for pgsql-bugs@arkaria.postgresql.org; Fri, 23 Aug 2019 21:49:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i1HR3-00056f-6j for pgsql-bugs@arkaria.postgresql.org; Fri, 23 Aug 2019 21:49:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1HR2-00056S-S0 for pgsql-bugs@lists.postgresql.org; Fri, 23 Aug 2019 21:49:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i1HR0-0003wp-8I for pgsql-bugs@lists.postgresql.org; Fri, 23 Aug 2019 21:49:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7NLnKgG019505; Fri, 23 Aug 2019 17:49:20 -0400 From: Tom Lane To: =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= cc: Michael Paquier , williamedwinallen@live.com, pgsql-bugs@lists.postgresql.org, Magnus Hagander Subject: Re: BUG #15858: could not stat file - over 4GB In-reply-to: References: <15858-9572469fd3b73263@postgresql.org> <20190619012604.GC2135@paquier.xyz> <16138.1560966010@sss.pgh.pa.us> <17044.1560967356@sss.pgh.pa.us> <20190626022236.GE1714@paquier.xyz> Comments: In-reply-to =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= message dated "Fri, 28 Jun 2019 23:34:38 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19503.1566596960.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Aug 2019 17:49:20 -0400 Message-ID: <19504.1566596960@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?UTF-8?Q?Juan_Jos=3DC3=3DA9_Santamar=3DC3=3DADa_Flecha?=3D writes: > On Wed, Jun 26, 2019 at 4:23 AM Michael Paquier wr= ote: >> It seems to me that you don't need the configure changes. > The changes in configuration are meant for gcc compilations in Windows > (Cygwin and Mingw). Directly editing the configure script is Not Done ... or at least, such changes wouldn't survive the next correctly-done configure update. You have to edit configure.in (or one of the sub-files in config/) and then regenerate configure using autoconf. It seems likely that we *don't* need or want this for Cygwin; that should be providing a reasonable stat() emulation already. So probably you just want to add "AC_LIBOBJ(win32_stat)" to the stanza beginning # Win32 (really MinGW) support if test "$PORTNAME" =3D "win32"; then AC_CHECK_FUNCS(_configthreadlocale) AC_REPLACE_FUNCS(gettimeofday) AC_LIBOBJ(dirmod) I'd also recommend that stat() fill all the fields in struct stat, even if you don't have anything better to put there than zeroes. Otherwise you're just opening things up for random misbehavior. I'm not in a position to comment on the details of the conversion from GetFileAttributesEx results to struct stat, but in general this seems like a reasonable way to proceed. regards, tom lane