Re: pg_basebackup stream xlog to tar - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_basebackup stream xlog to tar
Date
Msg-id CAB7nPqTO243vVeXPgRLr7PeaecoLVLrt7xs18ms+2rs7m=sh+Q@mail.gmail.com
Whole thread Raw
In response to Re: pg_basebackup stream xlog to tar  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Sun, Oct 23, 2016 at 10:52 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Sun, Oct 23, 2016 at 10:30 PM, Magnus Hagander <magnus@hagander.net> wrote:
>> I think both of those would be worthwhile. Just for the testability in
>> itself, but such a flag to pg_xlogdump would probably be useful in other
>> cases as well, beyond just the testing.
>
> Looking quickly at the code, it does not seem that complicated... I
> may just send patches tomorrow for all those things and be done with
> it, all that on its new dedicated thread.

Actually not that much after noticing that pg_xlogdump emulates some
of the backend's StringInfo routines and calls at the end vprintf() to
output everything to stdout, which is ugly. The cleanest solution here
would be to make StringInfo a bit more portable and allow them for
frontends, somehting that may be useful for any utility playing with
rm_desc. A less cleaner solution would be to somewhat store a fd
pointing to a file (or stdout) into compat.c and output to it. I'd
slightly prefer the first solution, but that does not seem worth the
effort just for pg_xlogdump and one test.
-- 
Michael



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [BUG] pg_basebackup from disconnected standby fails
Next
From: Andres Freund
Date:
Subject: Re: pg_basebackup stream xlog to tar