CSV-like output from psql

I’ve wondered on what’s the typical command-line invocation of psql utility (from PostgreSQL) to perform a SQL query and save output in CSV format (delimited with semicolon). So, I’ve finally read man psql and:

psql -F\; -A --pset footer -f input_file.sql -o output_file.csv database_name


Author: automatthias

You won't believe what a skeptic I am.