Re: pg_archivecleanup bug (invalid filename input) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_archivecleanup bug (invalid filename input)
Date
Msg-id CAB7nPqR99rYb_3L6ssByWh1td2ksxXCv=FzR6mpS5-PR9Q6N0w@mail.gmail.com
Whole thread Raw
In response to Re: pg_archivecleanup bug (invalid filename input)  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
On Wed, Jun 10, 2015 at 12:29 PM, Joshua D. Drake <jd@commandprompt.com> wrote:
>
> On 06/09/2015 05:54 PM, Michael Paquier wrote:
>
>> Looking at the documentation what is expected is not a path to a
>> segment file, but only a segment file name:
>> http://www.postgresql.org/docs/devel/static/pgarchivecleanup.html
>> So the current behavior is correct, it is actually what
>> SetWALFileNameForCleanup@pg_archivecleanup.c checks in the code.
>
>
> O.k.... so I would say: Should we adjust this behavior? It seems to me that
> it should accept a path.

Perhaps others have a different opinion, but I don't see much the
point. First, archive_cleanup_command uses %r with only a segment file
name. Then, in the case where pg_archivecleanup is called within a
script and that the segment name is retrieved from a given path that
you may want to append, this script is going to scan this directory to
fetch the segment file name anyway, actually killing the purpose of
appending a path.
-- 
Michael



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [idea] table partition + hash join
Next
From: Jan Wieck
Date:
Subject: s_lock() seems too aggressive for machines with many sockets