Re: Support for pg_receivexlog --post-segment command

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Feike Steenbergen <feikesteenbergen(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for pg_receivexlog --post-segment command
Date: 2017-01-06 14:42:22
Message-ID: CABUevEzGNPpC2p7KoB0g8pAppmqEv0Nx-Cr+rQ-dfvkh9kx7dA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 6, 2017 at 2:55 PM, David Steele <david(at)pgmasters(dot)net> wrote:

> On 1/6/17 8:49 AM, Feike Steenbergen wrote:
>
>>
>> On Fri, Jan 6, 2017 at 2:30 PM, David Steele <david(at)pgmasters(dot)net
>> <mailto:david(at)pgmasters(dot)net>> wrote:
>>
>>> For my part I still prefer an actual command to be executed so it will
>>>
>> start/restart the archiver if it is not already running or died. This
>> reduces the number of processes that I need to ensure are running.
>>
>>>
>>> If the consensus is that a signal is better then I'll make that work.
>>>
>> I will say this raises the bar on what is required to write a good
>> archive command and we already know it is quite a difficult task.
>>
>> On 6 January 2017 at 14:37, Magnus Hagander <magnus(at)hagander(dot)net
>> <mailto:magnus(at)hagander(dot)net>> wrote:
>>
>>> I like the idea of a command as well, for flexibility. If you want a
>>>
>> signal, you can write a trivial command that sends the signal... Maximum
>> flexibility, as long as we don't create a lot of caveats for users.
>>
>> Agreed, I think it is also easier to understand the mechanism (instead
>> of a signal), and would allow for some reuse of already existing scripts.
>>
>> If we do use a full command (vs a signal), I propose we do also offer
>> the %p and %f placeholders for the command.
>>
>
> Agreed. It shouldn't be that hard and could be very useful. If nothing
> else it will eliminate the need to configure path to the pg_receivexlog
> queue in the archiver.

Is there actual value in providing both %p and %f? It's not like it's
really hard to do, but since the path will be specified on the same
commandline, you could just put it in the command?

E.g.
pg_receivexlog -D /blah/foo --whatever /some/where/myscript %p
if you want the path in it could just be written
pg_receivexlog -D /blah/foo --whatever /some/where/myscript /blah/foo/%f

And you have that path in the *same place* already? (unless you want to
teach the script about it, in which case you want just %f anyway)

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2017-01-06 14:52:06 Re: [PATCH] guc-ify the formerly hard-coded MAX_SEND_SIZE to max_wal_send
Previous Message David Steele 2017-01-06 14:18:33 Re: Support for pg_receivexlog --format=plain|tar