pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Andrew Zimmerman <andrew@abcsoftek.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Error in COPY command with files over 1GB
Date: Fri, 9 Aug 2019 11:24:05 +0900
Message-ID: <20190809022405.GD3194@paquier.xyz> (raw)
In-Reply-To: <BN8PR04MB6033B0CB582CA6FBDCCA6EA2DED70@BN8PR04MB6033.namprd04.prod.outlook.com>
References: <BN8PR04MB6033B0CB582CA6FBDCCA6EA2DED70@BN8PR04MB6033.namprd04.prod.outlook.com>

On Thu, Aug 08, 2019 at 04:30:00PM +0000, Andrew Zimmerman wrote:
> I am getting the following error when importing from a tab-delimited text file longer than 1 GB.
> ERROR: could not stat file "C:\ABC Software\Database Export\Data\invoice_detail.data": Unknown error
> Splitting the tab-delimited file into multiple files less than 1 GB and COPY'ing them individually works correctly.
> I tested on both versions 11.2 and 11.4 on Windows with the same result.

This relates to the fact that Windows does not offer an easy way to
stat() correctly files which are more than 2GB, as the struct stat is
built with a 4-byte size field.

There has been some work on that lately (quoting Tom from a recent
mail):
https://www.postgresql.org/message-id/flat/1803D792815FC24D871C00D17AE95905CF5099%40g01jpexmbkw24

However there is no way that a complex patch would get back-patched,
and that's what we were heading to in the latest discussions I recall
on the matter.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)  latest in thread

Message-ID: <20190809022405.GD3194@paquier.xyz>
Permalink:  ../20190809022405.GD3194@paquier.xyz/
Also on:    postgresql.org/message-id/20190809022405.GD3194@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, andrew@abcsoftek.com
  Subject: Re: Error in COPY command with files over 1GB
  In-Reply-To: <20190809022405.GD3194@paquier.xyz>
  References: <BN8PR04MB6033B0CB582CA6FBDCCA6EA2DED70@BN8PR04MB6033.namprd04.prod.outlook.com> <20190809022405.GD3194@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox