Last active
December 21, 2015 21:39
-
-
Save ghl3/6369556 to your computer and use it in GitHub Desktop.
PSQL to CSV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Copy to a file as a csv */ | |
| Copy (SELECT * FROM foo) To '/tmp/test.csv' With CSV; | |
| /* Copy to std::out as tab separated values */ | |
| COPY (SELECT * FROM foo) TO STDOUT WITH DELIMITER E'\t' CSV HEADER; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment