Randomly sample rows from Postgres database and output as CSV