open terminal
su postgres
psql <db_name>
\f ','
\a
\t
\o outputfile.csv
select ..... (your sql select statement)
\o
\q
Additional notes: If you want a TAB delimited file instead of comma, use \f 'Ctrl-V TAB'. \f sets the field separator. \a echo all. \t tuples(rows) only. \q quit.
Posted by ⓒ쟁이™

금지!
