Re: Proposed doc-patch: Identifying the Current WAL file

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposed doc-patch: Identifying the Current WAL file
Дата
Msg-id 20245.1145123792@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposed doc-patch: Identifying the Current WAL file  (Jeff Frost <jeff@frostconsultingllc.com>)
Список pgsql-docs
Jeff Frost <jeff@frostconsultingllc.com> writes:
>>> ls -tp /pg_xlog/ | grep -v "backup\|/" | head -1
>>
>> What does the -p and \| pipe check do?  We don't have named pipes in
>> that directory, do we?

> The -p shows forward slashes after directories and the \| acts as an or and
> the / following that just lets us filter directories out.

This seems both overly cute and wrong, because it fails to filter plain
files that might have a new mtime but aren't WAL files.  I'd suggest a
simple test on file name to make sure it looks like a WAL file, ie,
24 hex digits.

    ls -t .../pg_xlog | grep
'^[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]$'
|head -1 

            regards, tom lane

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

Предыдущее
От: Jeff Frost
Дата:
Сообщение: Re: Proposed doc-patch: Identifying the Current WAL file
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposed doc-patch: Identifying the Current WAL file