How to export table as CSV with headings on Postgresql? September 15, 2022 by Tarik COPY products_273 TO '/tmp/products_199.csv' WITH (FORMAT CSV, HEADER); as described in the manual.