• Saving PL/pgSQL output from PostgreSQL to a CSV file

    Saving PL/pgSQL output from PostgreSQL to a CSV file

    Sometimes we need to save output of our queries to a CSV file format, may be with a different delimiter. In this article we are going to cover how to save psql output to a file. TL;DR: Copy (My amazing query) to /path/to/file.csv with CSV DELIMITER ‘,’ HEADER; In TL;DR section i mentioned only one…