Save PL/pgSQL output from PostgreSQL to a CSV file Save PL/pgSQL output from PostgreSQL to a CSV file postgresql postgresql