Postgres export to a CSV
Snippet
Yeah, kitt finished writing this at 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