Postgres export to csv
Thursday, July 31st, 2008To export PostgreSQL data to csv file using psql interactive terminal. open terminal su postgres psql <db_name> \f ',' \a \t \o outputfile.csv select ..... (your sql 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.



















