How to export CSV data from PostgreSQL
Just because I can never remember how to do this:
psql my_database -c "COPY (SELECT stuff FROM my_table) TO STDOUT CSV" > my_file.csv
Works in at least PostgreSQL 8.4.
Just because I can never remember how to do this:
psql my_database -c "COPY (SELECT stuff FROM my_table) TO STDOUT CSV" > my_file.csv
Works in at least PostgreSQL 8.4.