-- To stdout COPY (select * from table) TO STDOUT WITH CSV HEADER; -- To file COPY (select * from table) TO '/table.csv' WITH CSV HEADER;
COPY mytable FROM '/path/to/csv/file' WITH CSV HEADER; -- must be superuser