Created
December 9, 2019 11:28
-
-
Save Alexfilus/b8165142f13c8e31e43e1815ecbbabd5 to your computer and use it in GitHub Desktop.
PG to CSV
This file contains 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
psql -U postgres -d name -h host.com -p 5432 -c "COPY (SELECT id, name FROM user LIMIT 10) TO STDOUT With CSV HEADER DELIMITER ',';" > foo_data.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment