Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTVZB-00058T-Eh for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Oct 2020 19:39:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kTVZ9-00070v-GK for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Oct 2020 19:39:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTVZ9-00070o-AL for pgsql-bugs@lists.postgresql.org; Fri, 16 Oct 2020 19:39:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTVZ6-0006ht-Gf for pgsql-bugs@lists.postgresql.org; Fri, 16 Oct 2020 19:39:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 09GJcwA2033820; Fri, 16 Oct 2020 15:38:58 -0400 From: Tom Lane To: Mary LaClair cc: pgsql-bugs@lists.postgresql.org Subject: Re: copy command bug In-reply-to: References: Comments: In-reply-to Mary LaClair message dated "Fri, 16 Oct 2020 15:16:52 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <33818.1602877138.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Oct 2020 15:38:58 -0400 Message-ID: <33819.1602877138@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mary LaClair writes: > The copy command fails to load a large csv file (>2GB) with a "Could not= = > stat file" error.=C2=A0 This occurs on Windows with all versions since 1= 0.7. > It happens because fstat() on Windows fails with large csv files. Yeah, that's a well-known problem. It has been fixed in HEAD, cf https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3Db= ed90759fcbcd72d4d06969eebab81e47326f9a2 and some follow-up patches. But unfortunately that's too invasive for a back-patch, since it causes an ABI break for everything using "struct stat". I don't think we'll be terribly interested in hacking things to fix individual call sites instead, though. regards, tom lane