Re: Unlogged Crash Detection

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Gersner <gersner(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unlogged Crash Detection
Date: 2017-08-29 08:27:49
Message-ID: CAB7nPqQJqA=xDENt-XAijhPbizgZ6YfXpErHgqjuwxoDoLUV6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 29, 2017 at 5:17 PM, Gersner <gersner(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gersner 2017-08-29 09:06:33 Re: Unlogged Crash Detection
Previous Message Alban Hertroys 2017-08-29 08:20:05 Re: Performance with high correlation in group by on PK