copy psql query to csv