Skip to content

Export table from postgres to local csv

Pan Deng edited this page Jun 6, 2018 · 1 revision

The problems with the regular method: permission deny.

Solution:

sudo chmod 777 target/dir/

Then in psql:

\copy table TO '/target/dir/table.csv' DELIMITER ',' CSV HEADER;