Skip to content

Instantly share code, notes, and snippets.

@zerolab
Created March 27, 2014 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerolab/9813838 to your computer and use it in GitHub Desktop.
Save zerolab/9813838 to your computer and use it in GitHub Desktop.
Postgres: output results to CSV file
\f ','
\a
\t
\o /tmp/output.csv
SELECT column_id, column_name FROM TABLE_NAME;
\o
\q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment