Re: BUG #15654: COPY command not working for 2gb CSV files

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #15654: COPY command not working for 2gb CSV files
Дата
Msg-id CAKJS1f_qgyV4C_3g66ii2mVS7sjx05-PPXekyEE5iXJbsGHC7w@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #15654: COPY command not working for 2gb CSV files  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15654: COPY command not working for 2gb CSV files  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-bugs
On Tue, 26 Feb 2019 at 00:35, PG Bug reporting form
<noreply@postgresql.org> wrote:
> Command I am using
> -----------------------------
> Copy table From '<Filename>.csv' DELIMITER '~' null as 'null'  encoding
> 'windows-1251' CSV; select 1;
>
> Error I am getting
> ------------------------
> ERROR:  could not stat file "<Filename>.csv": Unknown error
> SQL state: XX000

I can recreate that here.  The error comes from the call to fstat() in
BeginCopyFrom().

Going by the Microsoft documentation fstat() only has a file length
type of 32bits.


https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32?view=vs-2017

Seems to work if I change the fstat() call to _fstati64() and change
the type of st to struct _stat64. Perhaps we need to wrap some macros
around these in port and have windows use the 64-bit versions.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Prakash Ramakrishnan
Дата:
Сообщение: Re: BUG #15648: oracle_fdw extension not able to create
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15655: local machines pushed openvpn dns issue