Hi. I have a need to pipe the output from pg_basebackup for a
multi-tablespace cluster into another program without spooling to
disk. Seeing as the current -F tar output format can't do that, I've
made an attempt at implementing that myself.
As a side effect I've refactored the some of the pg_basebackup code
for readability and reusability, as well as implemented support for
longer filenames in tar output (not used by default for
compatibility). There is also a fix for a bug where pg_basebackup will
drop a zero-length file at the end of a tablespace's tar stream.
I've put my changes up as a series of relatively small commits on this
branch of a github fork:
https://github.com/jre/postgres/commits/single-tar
Comments and suggestions are welcome.