pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ravi Krishna <srkrishna1@aol.com>
To: david.g.johnston@gmail.com
To: pgsql-general@lists.postgresql.org
Subject: Re: Truncation of UNLOGGED tables upon restart.
Date: Thu, 1 Nov 2018 21:20:19 +0000 (UTC)
Message-ID: <1177060548.6477958.1541107219801@mail.yahoo.com> (raw)
In-Reply-To: <CAKFQuwaXNVdT6N75ZbjvO8+wySn=iW5xyc3Ox+faZ=XP_gz3rw@mail.gmail.com>
References: <1951433141.20816140.1541105355093.ref@mail.yahoo.com>
	<1951433141.20816140.1541105355093@mail.yahoo.com>
	<CAKFQuwaXNVdT6N75ZbjvO8+wySn=iW5xyc3Ox+faZ=XP_gz3rw@mail.gmail.com>


> There is no such thing as a "read only" table in PostgreSQL.  All tables are read/write no matter that frequency of either event.  There is nothing > inherently special about "no writes for 4 days" and "no writes for 10 seconds" that would allow 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 whether any 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 until next weekend, why not create those tables as unlogged.









view thread (7+ messages)  latest in thread

Message-ID: <1177060548.6477958.1541107219801@mail.yahoo.com>
Permalink:  ../1177060548.6477958.1541107219801@mail.yahoo.com/
Also on:    postgresql.org/message-id/1177060548.6477958.1541107219801@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: srkrishna1@aol.com, david.g.johnston@gmail.com
  Subject: Re: Truncation of UNLOGGED tables upon restart.
  In-Reply-To: <1177060548.6477958.1541107219801@mail.yahoo.com>
  References: <1951433141.20816140.1541105355093.ref@mail.yahoo.com> <1951433141.20816140.1541105355093@mail.yahoo.com> <CAKFQuwaXNVdT6N75ZbjvO8+wySn=iW5xyc3Ox+faZ=XP_gz3rw@mail.gmail.com> <1177060548.6477958.1541107219801@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox