citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.5k stars 666 forks source link

Unify MultiClientCopyData and CopyDataFromConnection #3330

Open pykello opened 4 years ago

pykello commented 4 years ago

MultiClientCopyData in multi_client_executor.c and CopyDataFromConnection in intermediate_results.c do the same thing with slight differences. Both implement the logic described in https://www.postgresql.org/docs/current/libpq-copy.html. We should unify them to avoid code duplication.

serprex commented 4 years ago

I've created a branch merge-copy-data-from-conn-to-file-functions which unifies the functions by using a function pointer for write. It drops an error message, "could not read data from worker node"