how to create a csv file from postgresql table code example
Example: postgresql export output table as a csv
COPY table_name TO 'file_name.csv' DELIMITER ',' CSV HEADER;
COPY table_name TO 'file_name.csv' DELIMITER ',' CSV HEADER;