COPY cart_freight TO '/tmp/products_199.csv' WITH (FORMAT CSV, HEADER);
PSQL to the command line.
write the select statement and output to a CSV file on the filesystem.