Skip to content

Instantly share code, notes, and snippets.

@joshbeckman
Created September 19, 2013 15:17
Show Gist options
  • Save joshbeckman/6625050 to your computer and use it in GitHub Desktop.
Save joshbeckman/6625050 to your computer and use it in GitHub Desktop.
Dump data from a heroku pg databse into a local csv.
# 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