rufus05
rufus05

Reputation: 43

Error import from .csv to table - Postgres - AWS-RDS

Error when importing csv file to postgres database in AWS RDS:

Code:

COPY public."tableTest" FROM 'C:\Temp\tableTest.csv' DELIMITER ';' CSV HEADER ENCODING 'LATIN1';

Erro:

enter image description here

If I try to import it into my postgres on my desktop, it works. The error only happens in RDS and I am using the same database structure.

Upvotes: 0

Views: 293

Answers (1)

rufus05
rufus05

Reputation: 43

I managed to import the .csv through the Windows terminal with the following command:

psql --host xxxxxxxxxxxx.us-east-1.rds.amazonaws.com --port 5432 --username postgres --dbname newDatabase -c "\copy public.tableTest FROM 'C:\Temp\tableTest.csv' DELIMITER ';' CSV HEADER ENCODING 'LATIN1';"

Upvotes: 1

Related Questions