I’m trying to upload a large, comma delimited, text file using the psql tool. The .txt file has about 20 column names already. The file is about 2GB in size and has approximately 14 million rows. A handful of the columns are mostly empty.
The .txt file looks like this (table):
boyID, girlID, dateID, actionID
“1234”,”4321”,”Jan 12 2008”,”abc123”
I created a new table in psql, and here we’ll call it “tablename”. I gave the table slightly different column names but still in the same order as the existing column names.
I then executed the following command to try and copy the data from my text file to the new table I just created:
COPY tablename (boyid, girlid, dateid, actionid)
FROM 'C:\filename\textfile.txt'
WITH CSV HEADER DELIMITER AS ',';
I get a message that says “cannot stat file” with “unknown error”.
I’ve tried using pgAdmin 4 as well and get the same message. I should also note I got that last part of my code from here.
P.S. I’m very new to this. (But I really enjoy it!)
Thank you all in advance.