Re: Command to prune archive at restartpoints

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Command to prune archive at restartpoints
Дата
Msg-id m2hbl9sa9a.fsf@hi-media.com
обсуждение исходный текст
Ответ на Re: Command to prune archive at restartpoints  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Command to prune archive at restartpoints  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
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 that we have internal command for simple case, and SRF for use in
scripts in more complex case.

> Of course, if there's a perl one-liner to do that, we can just put that in
> the docs and don't really need pg_cleanuparchive at all.

psql -c "SELECT * FROM pg_cleanup_archive('00000001000000000000002F');"

>> Therefore my take on this problem is to provide internal commands here,
>> that maybe wouldn't need to be explicitly passed any argument. If
>> they're internal they certainly can access to the information they need?
>
> You want more flexibility in more advanced cases. Like if you have multiple
> standbys sharing the archive, you only want to remove old WAL files after
> they're not needed by *any* of the standbys anymore. Doing the cleanup
> directly in the archive_cleanup_command would cause the old WAL files to be
> removed prematurely, but you could put a shell script there to store the
> location to a file, and call pg_cleanuparchive with the max() of the
> locations reported by all standby servers.

Yes you still need to support external commands. That was not at all
what I'm proposing: I'm just after having the simple case dead simple to
setup. Like you don't write any script.

Regards,
-- 
dim


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Error with GIT Repository
Следующее
От: Joseph Adams
Дата:
Сообщение: Re: hstore ==> and deprecate =>