I've to import a CSV file into a Postgres database.

I've tried using a scanner but it's very slow (the file has more than 9000 rows).

I've also tried to use the command "COPY", but it gave me the error "permission denied". I know I haveve to give reading permission on the file's folder, but I don't like this solution.

Is there another way to perform this operation?

share|improve this question
    
Using COPY command is the fastest way to import you CSV file. You can also try to use Spring-Batch – nikita_pavlenko yesterday
1  
Here: stackoverflow.com/questions/44290348/… is working example how to parse csv file. If you show structure of the fields of your csv files, we can help your adapted it for you. – Vasyl Lyashkevych yesterday
    
Use the CopyManager, see here or here or here – a_horse_with_no_name yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.