Re: [GENERAL] Unlogged Crash Detection

Поиск
Список
Период
Сортировка
От Gersner
Тема Re: [GENERAL] Unlogged Crash Detection
Дата
Msg-id CALKrh6nmW+Hde=mRCBZ6_6W9C8wZ=dgb1WqHGA+ONCeD7igA9g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Unlogged Crash Detection  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [GENERAL] Unlogged Crash Detection
Список pgsql-general
I see, interesting.

We have lots of unlogged tables, upon a crash we want to create a feedback/alert that data disappeared.

Not very familiar with the internal structure, but is it possible to identify if the current table is the INIT_FORKNUM?

Gersner

On Tue, Aug 29, 2017 at 11:27 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Tue, Aug 29, 2017 at 5:17 PM, Gersner <gersner@gmail.com> wrote:
> Is there a reliable way to distinguish between an empty unlogged table to an
> unlogged table which has been truncated due to a crash?

Why do you want to make such a difference? At the beginning of a crash
recovery all the, the existing relation files of unlogged tables are
all removed, and replaced by the init forknum which represents their
initial state. You can see by yourself ResetUnloggedRelations &
friends in reinit.c.
--
Michael

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [GENERAL] Unlogged Crash Detection
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [GENERAL] Unlogged Crash Detection