Re: Command to prune archive at restartpoints

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Command to prune archive at restartpoints
Дата
Msg-id m2ljakw2qk.fsf@hi-media.com
обсуждение исходный текст
Ответ на Re: Command to prune archive at restartpoints  (Dimitri Fontaine <dfontaine@hi-media.com>)
Ответы Re: Command to prune archive at restartpoints  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
Dimitri Fontaine <dfontaine@hi-media.com> writes:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> So to clean up all WAL files older than those needed by that base backup,
>> you would simply copy-paste that location and call pg_cleanuparchive:
>>
>> pg_cleanuparchive /walarchive/ 00000001000000000000002F
>
> Ok, idle though: what about having a superuser-only SRF doing the
> same?

So I'm looking at what it'd take to have that code, and it seems it
would be quite easy. I wonder if we want to return only a boolean
(command success status) or the list of files we're pruning (that's the
SRF part), but other than that, it's all about having the code provided
by Simon in another place and some internal command support.

Something strange though: I notice that the error and signal handling in
pgarch.c::pgarch_archiveXlog (lines 551 and following) and in
xlog.c::ExecuteRecoveryCommand (lines 3143 and following) are very
different for no reason that I can see.

Why is that?

Also, should I try to send a patch implementing my proposal (internal
command exposed as a function at the SQL level, and while at it, maybe
the internal command "pg_archive_bypass" to mimic /usr/bin/true as an
archive_command)?

Regards,
-- 
dim


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: hstore ==> and deprecate =>
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Command to prune archive at restartpoints