Re: Truncation of UNLOGGED tables upon restart. - Mailing list pgsql-general

From Ravi Krishna
Subject Re: Truncation of UNLOGGED tables upon restart.
Date
Msg-id 1177060548.6477958.1541107219801@mail.yahoo.com
Whole thread Raw
In response to Re: Truncation of UNLOGGED tables upon restart.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Truncation of UNLOGGED tables upon restart.
List pgsql-general
> There is no such thing as a "read only" table in PostgreSQL.  All tables are read/write no matter that frequency of
eitherevent.  There is nothing > inherently special about "no writes for 4 days" and "no writes for 10 seconds" that
wouldallow for a distinction to be made.  There could be write > in progress on the table just as it crashes Friday. 

I am aware that unlogged tables have no entries in WAL, but I assumed (incorrectly) that PG will at least keep track
whetherany writes was done on a table since last checkpoint, and if none, it will find no reason to truncate it. 

The use case I was thinking about is that if we have to load a large set of data every weekend and use it for reporting
untilnext weekend, why not create those tables as unlogged. 







pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Truncation of UNLOGGED tables upon restart.
Next
From: Tim Cross
Date:
Subject: Re: Add columns to table; insert values based on row