Skip to content

Instantly share code, notes, and snippets.

@vladox
Last active November 3, 2016 11:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vladox/587e8b90fa4180ee450838a2fba8700c to your computer and use it in GitHub Desktop.
Export a SQL query result in Postgres to a CSV file.
COPY(select * from your_table_name) TO '/the/path/to/your/file/your_table_name.csv' WITH CSV DELIMITER ',' HEADER;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment