[HACKERS] [PATCH 6/6] pg_basebackup: add a single-tar output format.

2015-09-29 Thread Joshua Elsasser
This will write one single tar file containing all tablespaces, and can be written to stdout. --- src/bin/pg_basebackup/pg_basebackup.c | 282 -- 1 file changed, 269 insertions(+), 13 deletions(-) diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_bas

Re: [HACKERS] Add pg_basebackup single tar output format

2015-09-29 Thread Joshua Elsasser
On Tue, Sep 29, 2015 at 11:50:37PM +0200, Andres Freund wrote: > On 2015-09-29 14:38:11 -0700, Josh Elsasser wrote: > > 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 a

[HACKERS] [PATCH 2/6] pg_basebackup: factor out tar open/close code for reusability.

2015-09-29 Thread Joshua Elsasser
This adds a simple struct and open and close functions to abstract and isolate the zlib vs. stdio output logic and allow it to be reused. --- src/bin/pg_basebackup/pg_basebackup.c | 300 +- 1 file changed, 154 insertions(+), 146 deletions(-) diff --git a/src/bin/pg

[HACKERS] [PATCH 4/6] pg_basebackup: don't lose a zero-length file at the end of a tablespace.

2015-09-29 Thread Joshua Elsasser
After a complete tar header was buffered it would only be processed during the next iteration of the read loop. A zero-length file such as a directory had no data to read, so the loop would exit without ever having processed the file. --- src/bin/pg_basebackup/pg_basebackup.c | 238 +++

[HACKERS] [PATCH 5/6] pg_basebackup: allow GetConnection() to make non-replication connections.

2015-09-29 Thread Joshua Elsasser
--- src/bin/pg_basebackup/pg_basebackup.c | 4 ++-- src/bin/pg_basebackup/pg_receivexlog.c | 4 ++-- src/bin/pg_basebackup/pg_recvlogical.c | 4 ++-- src/bin/pg_basebackup/streamutil.c | 6 +++--- src/bin/pg_basebackup/streamutil.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-

[HACKERS] [PATCH 1/6] Add support for longer filenames in tar headers (up to 254 bytes).

2015-09-29 Thread Joshua Elsasser
New functions tarHeaderRename() and tarHeaderGetName() are exposed to store and retrieve the longer filenames. tarCreateHeader() continues to limit filenames to 99 bytes to preserve compatability with existing consumers. --- src/include/pgtar.h | 2 + src/port/tar.c | 134 +

[HACKERS] [PATCH 3/6] pg_basebackup: factor out code to add a recovery.conf file to the tar file.

2015-09-29 Thread Joshua Elsasser
This is just a simple refactor for readability and reusability. --- src/bin/pg_basebackup/pg_basebackup.c | 46 --- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index f