Skip to content

Instantly share code, notes, and snippets.

@baybatu
Created February 16, 2022 05:51
Show Gist options
  • Save baybatu/2c880788c185a6707336519a1ba4ba1e to your computer and use it in GitHub Desktop.
Save baybatu/2c880788c185a6707336519a1ba4ba1e to your computer and use it in GitHub Desktop.
export psql query result to csv file
\copy (select column1, column2 from mytable) To '/tmp/dump.csv' With CSV DELIMITER ',' HEADER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment