Skip to content

Instantly share code, notes, and snippets.

@adam704a
Last active October 6, 2017 21:06
Show Gist options
  • Save adam704a/7e5f9236fffd9b5947232b467e5c1ec6 to your computer and use it in GitHub Desktop.
Save adam704a/7e5f9236fffd9b5947232b467e5c1ec6 to your computer and use it in GitHub Desktop.
export a sql view to s3
DATE_WITH_TIME=`date "+%Y%m%d"`
psql -h localhost dhis2 -c "\copy (SELECT * FROM _view_analytics) to './dhis2-export.tsv' WITH NULL AS ''"
aws s3 cp dhis2-export.csv s3://stoppalu-dhis2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment