pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15671: The copy command does not load all the lines from a .csv file.
2+ messages / 2 participants
[nested] [flat]
* BUG #15671: The copy command does not load all the lines from a .csv file.
@ 2019-03-06 15:03 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2019-03-06 15:03 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: ezenchenko@gmail.com
The following bug has been logged on the website:
Bug reference: 15671
Logged by: Эдуард Зенченко
Email address: ezenchenko@gmail.com
PostgreSQL version: 10.4
Operating system: Debian 4.9
Description:
Hello!
There is a .csv file in windows-1251 encoding.
The file has 1165988 lines, along with the title.
I need to upload it to the table.
I execute the command in PgAdmin 4:
drop table test_csv;
create table test_csv (addr text, houseid text);
copy test_csv (addr, houseid) FROM '/tmp/gis_fias_kra.csv' (DELIMITER ';',
FORMAT CSV, NULL '\', HEADER, ENCODING 'win1251');
In response, I get:
COPY 993130
Query returned successfully in 7 secs 352 msec.
In table 993130 records.
The file is located in a directory on the server.
Why aren't all the lines from the .csv file loaded? This is very similar to
an error in the application.
The same file was loaded using pgloader, and all lines were loaded.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #15671: The copy command does not load all the lines from a .csv file.
@ 2019-03-06 15:46 Jeff Janes <jeff.janes@gmail.com>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Janes @ 2019-03-06 15:46 UTC (permalink / raw)
To: ezenchenko@gmail.com; pgsql-bugs@lists.postgresql.org
On Wed, Mar 6, 2019 at 10:34 AM PG Bug reporting form <
noreply@postgresql.org> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 15671
> Logged by: Эдуард Зенченко
> Email address: ezenchenko@gmail.com
> PostgreSQL version: 10.4
> Operating system: Debian 4.9
> Description:
>
> Hello!
> There is a .csv file in windows-1251 encoding.
> The file has 1165988 lines, along with the title.
> I need to upload it to the table.
> I execute the command in PgAdmin 4:
>
> drop table test_csv;
> create table test_csv (addr text, houseid text);
> copy test_csv (addr, houseid) FROM '/tmp/gis_fias_kra.csv' (DELIMITER ';',
> FORMAT CSV, NULL '\', HEADER, ENCODING 'win1251');
>
> In response, I get:
> COPY 993130
> Query returned successfully in 7 secs 352 msec.
>
> In table 993130 records.
> The file is located in a directory on the server.
>
> Why aren't all the lines from the .csv file loaded?
How are you counting the lines in the file? Are any of your newline
characters escaped by being quoted?
select count(*) from test_csv where addr text like E'%\n%' or houseid like
E'%\n%';
Cheers,
Jeff
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-03-06 15:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 15:03 BUG #15671: The copy command does not load all the lines from a .csv file. PG Bug reporting form <noreply@postgresql.org>
2019-03-06 15:46 ` Jeff Janes <jeff.janes@gmail.com>
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