Re: Make unlogged table resets detectable - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Make unlogged table resets detectable
Date
Msg-id 954419.1623092217@sss.pgh.pa.us
Whole thread Raw
In response to Re: Make unlogged table resets detectable  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Make unlogged table resets detectable
Re: Make unlogged table resets detectable
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Jun 4, 2021 at 8:41 PM Jeff Davis <pgsql@j-davis.com> wrote:
>> Stepping back, maybe unlogged tables are the wrong level to solve this
>> problem. We could just have a "crash counter" in pg_control that would
>> be incremented every time a crash happened (and all unlogged tables are
>> reset). It might be a number or maybe the LSN of the startup checkpoint
>> after the most recent crash.

> I think this would be useful for a variety of purposes. Both being
> able to know the last time that it happened and being able to know the
> number of times that it happened could be useful, depending on the
> scenario.

+1.  I'd support recording the time of the last crash recovery, as
well as having a counter.  I think an LSN would not be as useful
as a timestamp.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Make unlogged table resets detectable
Next
From: Robert Haas
Date:
Subject: Re: Race condition in recovery?