简体   繁体   中英

Copy a 8GB txt file into table

I'm trying to copy data from a 8GB txt file into a table in Postgres 13 using Windows 10 psql prompt. The command I'm using is:

\copy PERSON1 FROM 'D:\final3\FINAL\FINAL.txt' (DELIMITER('|'));

And I'm getting this error:

Can not stat file «D:/final3/FINAL/FINAL.txt»: value too large

Any idea of how to modify the max size of copy in psql13?

Add two lines to your txt file: One at the begining and one at the end:

COPY PERSON1 FROM STDIN ( DELIMITER '|' );
<here are the lines your txt file already contains>
\.

Don't forget another newline after the \\. line. Then call

psql -h *hostname* -d *dbname* -U *username* -f 'D:\final3\FINAL\FINAL.txt'

I got similar error after new installation of pgAdmin 4 v4. When I returned to Postgres 9.6 in bin\\ psql version nothing like that happen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM