Postgres export to a CSV
Snippet
kitt decided around 10:31 on 16 November 2023 to publish this:
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