Skip to content

Instantly share code, notes, and snippets.

@danromero
Last active December 27, 2015 15:39
Show Gist options
  • Save danromero/7349320 to your computer and use it in GitHub Desktop.
Save danromero/7349320 to your computer and use it in GitHub Desktop.
Commands to sanitize and import a Heroku Postgres dump into Postgres.app on a Mac
pg_restore dumpfile >plaintext.sql
iconv -c -f UTF-8 -t UTF-8 <plaintext.sql >plaintext-cleaned.sql
psql dbname < plaintext-cleaned.sql
COPY table TO 'data.csv' DELIMITER ',' CSV HEADER;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment