Refactor postgres.dump_all to dump