-- Client side -This approach does the file handling on the client side
Copy (Select * From foo) To '/tmp/test.csv' With CSV DELIMITER ',' HEADER
-- Server side - This approach runs entirely on the remote server
Copy (Select * From foo) To '/tmp/test.csv' With CSV DELIMITER ',' HEADER;
psql arco -c "copy (select url from urltable where scoreid=1 limit 25000) to '/h/u544835/data25000.csv'"