You can use psql command to import CSV data file to automate the process of importing data.