Output Query as CSV (PostgreSQL)

From ben.goodacre.name/tech

Jump to: navigation, search

Use the following to output a query a CSV. Offending characters like new-lines and conmmas are automatically stripped:

COPY ( select * from table ) to '/var/tmp/query.csv' with csv header;
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox