Re: [GENERAL] Unlogged Crash Detection - Mailing list pgsql-general

From Michael Paquier
Subject Re: [GENERAL] Unlogged Crash Detection
Date
Msg-id CAB7nPqQJqA=xDENt-XAijhPbizgZ6YfXpErHgqjuwxoDoLUV6A@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Unlogged Crash Detection  (Gersner <gersner@gmail.com>)
Responses Re: [GENERAL] Unlogged Crash Detection  (Gersner <gersner@gmail.com>)
List pgsql-general
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 by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: [GENERAL] Performance with high correlation in group by on PK
Next
From: Gersner
Date:
Subject: Re: [GENERAL] Unlogged Crash Detection