pg_basebackup: Refactor code for reading COPY and tar data.
Robert Haas <rhaas@postgresql.org>
pg_basebackup: Refactor code for reading COPY and tar data. Add a new function ReceiveCopyData that does just that, taking a callback as an argument to specify what should be done with each chunk as it is received. This allows a single copy of the logic to be shared between ReceiveTarFile and ReceiveAndUnpackTarFile, and eliminates a few #ifdef conditions based on HAVE_LIBZ. While this is slightly more code, it's arguably clearer, and there is a pending patch that introduces additional calls to ReceiveCopyData. This commit is not intended to result in any functional change. Discussion: http://postgr.es/m/CA+TgmoYZDTHbSpwZtW=JDgAhwVAYvmdSrRUjOd+AYdfNNXVBDg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_basebackup/pg_basebackup.c | modified | +507 −498 |
Discussion
- backup manifests 318 messages · 2019-09-18 → 2020-05-15