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%';