Skip to content

Instantly share code, notes, and snippets.

@kgantsov
Last active March 4, 2019 12:52
Show Gist options
  • Select an option

  • Save kgantsov/d8a30bbbf7386d1b5142d0e65a8b79b3 to your computer and use it in GitHub Desktop.

Select an option

Save kgantsov/d8a30bbbf7386d1b5142d0e65a8b79b3 to your computer and use it in GitHub Desktop.
Dump postgresql table to a csv file
psql postgresql://user:password@localhost:5432/database -A -F ";" -c "SELECT * FROM users" > users.csv
template1=# Copy (SELECT * FROM users) To '/tmp/users.csv' With CSV DELIMITER ';';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment