Skip to content

Instantly share code, notes, and snippets.

@fike
Created August 14, 2012 21:44
Show Gist options
  • Save fike/3353313 to your computer and use it in GitHub Desktop.
Save fike/3353313 to your computer and use it in GitHub Desktop.
Loading multiple files csv in postgresql
#!/bin/sh
for i in $(ls *.csv)
do psql -U postgres -c "COPY carga FROM '/tmp/$i' WITH DELIMITER ',' CSV HEADER" test;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment