Last active
December 27, 2015 15:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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