Skip to content

Instantly share code, notes, and snippets.

@ryanwi
Created February 22, 2016 00:11
Show Gist options
  • Save ryanwi/bb9ded2021ae5ce423db to your computer and use it in GitHub Desktop.
Save ryanwi/bb9ded2021ae5ce423db to your computer and use it in GitHub Desktop.
Export Query Results as CSV
$ psql -d postgres://username:password@server:port/database -t -A -F"," -c "query" > output.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment