pg_basebackup: Avoid unclean failure with server-compression and -D -.
authorRobert Haas <rhaas@postgresql.org>
Fri, 11 Mar 2022 17:22:02 +0000 (12:22 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 11 Mar 2022 17:22:02 +0000 (12:22 -0500)
commitb2de45f9200d9adcac50015521574696dc464ccd
tree57555fc4bf4abc8923b80c0d037b861526aaac80
parente94bb1473eb36e19c200476cebc3750cf6a978e7
pg_basebackup: Avoid unclean failure with server-compression and -D -.

Fail with a suitable error message instead. We can't inject the backup
manifest into the output tarfile without decompressing it, and if
we did that, we'd have to recompress the tarfile afterwards to produce
the result the user is expecting. While we have enough infrastructure
in pg_basebackup now to accomplish that whole series of steps without
much additional code, it seems like excessively surprising behavior.
The user probably did not select server-side compression with the idea
that the client was going to end up decompressing it and then
recompressing.

Report from Justin Pryzby. Fix by me.

Discussion: http://postgr.es/m/CA+Tgmob6Rnjz-Qv32h3yJn8nnUkLhrtQDAS4y5AtsgtorAFHRA@mail.gmail.com
src/bin/pg_basebackup/pg_basebackup.c