To quickly import a CSV file into a PostgreSQL table:

SET DateStyle = 'ISO, DMY'; -- Set the correct date format
copy mytable (column1, column2) from 'local-file.csv' delimiter ',' csv header; -- Import the files

If you want, you can also stream from stdin:

SET DateStyle = 'ISO, DMY'; -- Set the correct date format
copy mytable (column1, column2) from STDIN delimiter ',' csv header; -- Import the files

You can then run it from the shell like this:

psql -h remotehost -d remote_mydb -U myuser -c \
    "copy mytable (column1, column2) from STDIN with delimiter as ','" \
    < /path/to/local/file.csv