Export:

1
2
\copy (SELECT * FROM your_table)
TO '/tmp/your_table.csv' CSV HEADER FORCE QUOTE *;

Import:

1
\copy your_table FROM '/tmp/your_table.csv' CSV HEADER;