Postgres – Output to CSV

Quick and dirty export Postgres table to csv file:

psql dbname
\f ‘,’
\a
\o outputfile.csv
select * from table;
\o
\q

Bad Behavior has blocked 295 access attempts in the last 7 days.