Created
September 19, 2013 15:17
-
-
Save joshbeckman/6625050 to your computer and use it in GitHub Desktop.
Dump data from a heroku pg databse into a local csv.
This file contains 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
# Run in bash: | |
heroku pg:psql | |
# Run in the psql CLI: | |
\copy (SELECT id, name, longitude, latitude FROM cities) TO cities.csv CSV DELIMITER ',' | |
# Run in the psql CLI: | |
\q | |
# Voila! csv is in your pwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment