cat file.txt | psql -d dbname -c "copy mytable from stdin csv" #### < file.txt psql -d dbname -c "copy mytable from stdin csv"