www.fromthevalley.com.au

Extract data from SQL to CSV from command line

 

 

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.

 

 

 

HOME |  AJAX |  APACHE |  Bizphone |  CSS |  DNS |  General |  Graphics |  HTML |  Hardware |  Javascript |  Linux |  MAC |  MS SQL |  Mail |  Microsoft |  OFFICE 365 |  Perl |  Postgres |  SEO |  Social Media |  VMware |  Windows 10