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.

 

 

 

HOMEAJAXAPACHEBizphoneCSSDNSGeneralGraphicsHTMLHardwareJavascriptLinuxMACMS SQLMailMicrosoftOFFICE 365PerlPostgresSEOSocial MediaVMwareWindows 10