Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIKOH-0001dC-2J for pgsql-general@arkaria.postgresql.org; Thu, 01 Nov 2018 21:20:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIKOF-0001O3-BJ for pgsql-general@arkaria.postgresql.org; Thu, 01 Nov 2018 21:20:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIKOE-0001Nj-NR for pgsql-general@lists.postgresql.org; Thu, 01 Nov 2018 21:20:31 +0000 Received: from sonic308-3.consmr.mail.bf2.yahoo.com ([74.6.130.42]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIKOA-0003ZU-Qx for pgsql-general@lists.postgresql.org; Thu, 01 Nov 2018 21:20:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1541107223; bh=anv329Etm7ogNNWaJ3ZCTCxbKHMDoxz4lQMUwsIciWw=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=TC5eWj5xm20To3z8dBeTyq0o9cc1h5G+Io9+UYM4W8CHyQZjZ0KhW3ZONezZv++4+PcjDVQUoLKJ+hHh7hZcP+YaUXCHrtStW+7abNZ7dY8Kp/UlCOItlZZrPt+ZDPSgrHI42dMu4cxaKiY+CvChDKXWv3DOm+AXJaShwikBS115tAv1EyNKUa8TT6T7hRwCyyDO7QjR30M09u5KFrsqE+DPsLuF4Egyl02CSmunkkTtoA/WcDp2Mv32cwa4gIywqmA11mD1H4WIAS9GFUZ2TYXmgnR3PovVawf9i45rZzqAorYTJTO/aiE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.mail.ne1.yahoo.com by sonic308.consmr.mail.bf2.yahoo.com with HTTP; Thu, 1 Nov 2018 21:20:23 +0000 Date: Thu, 1 Nov 2018 21:20:19 +0000 (UTC) From: Ravi Krishna To: david.g.johnston@gmail.com, pgsql-general@lists.postgresql.org Message-ID: <1177060548.6477958.1541107219801@mail.yahoo.com> In-Reply-To: References: <1951433141.20816140.1541105355093.ref@mail.yahoo.com> <1951433141.20816140.1541105355093@mail.yahoo.com> Subject: Re: Truncation of UNLOGGED tables upon restart. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.12512 aolwebmail Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 Content-Length: 807 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > There is no such thing as a "read only" table in PostgreSQL.=C2=A0 All ta= bles are read/write no matter that frequency of either event.=C2=A0 There i= s nothing > inherently special about "no writes for 4 days" and "no writes = for 10 seconds" that would allow for a distinction to be made.=C2=A0 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 (inco= rrectly) 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 truncat= e 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 cr= eate those tables as unlogged.