export table to csv on postgres
问题 How can I export a table to .csv in Postgres, when I'm not superuser and can't use the copy command? I can still import the data to postgres with "import" button on the right click, but no export option. 回答1: Use psql and redirect stream to file: psql -U <USER> -d <DB_NAME> -c "COPY <YOUR_TABLE> TO stdout DELIMITER ',' CSV HEADER;" > file.csv 回答2: COPY your_table TO '/path/to/your/file.csv' DELIMITER ',' CSV HEADER; For more details go to this manual 回答3: Besides what marvinorez's suggests in