Update export_sql to support redshift. redshift is based on postgres 8.0.2 that does not support copy from select.
Fix incorrect latitude/longitude issue after numeric conversion in redshift.