I am trying to export data from a select statement to a csv where the filename is made up in part by the date-time stamp.
eg export_2014-12-23-14-56 (export_yyyy_mm_dd_hh_mm) but I would take any format.
The code that currently generates the export is
cd c:\program files\postgresql\9.2\bin
psql -U postgres -h 10.0.0.69 -d mbs01 -f -t -A -F"," -c "select * from bespoke.fedex_export" > y:\warehouse\fedex\fedex_export2.txt -L e:\fedex_export.txt