Postgres export to a CSV
Snippet
Written with a loving hand by kitt some time around 10:31 on 16 November 2023
Easy export to a CSV file, with headers.
# sql \COPY (SELECT * FROM report_view_table) TO 'export.csv' DELIMITER ',' CSV HEADER; # bash psql $DATABASE -c "\COPY (SELECT * FROM report_table) TO 'export.csv' DELIMITER ',' CSV HEADER;"
Add new comment