postgresql export query results to csv code example
Example 1: postgresql export output table as a csv
COPY table_name TO 'file_name.csv' DELIMITER ',' CSV HEADER;
Example 2: postgresql import data from csv
copy table from '/home/usama/Documents/columns_rearrange.csv' csv header ;