Are all unlogged tables in any case truncated after a server-crash? - Mailing list pgsql-general

From sch8el@posteo.de
Subject Are all unlogged tables in any case truncated after a server-crash?
Date
Msg-id c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de
Whole thread Raw
Responses Re: Are all unlogged tables in any case truncated after a server-crash?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Are all unlogged tables in any case truncated after a server-crash?  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
Hi everyone,

every few weeks I use Postgres ability, to import huge data sets very 
fast by means of "unlogged tables". The bulk load (consisting of plenty 
"copy"- & DML-Stmts) and the spatial index creation afterwards, takes 
about 5 hours on a proper server  (pg12.7 & PostGIS-Extension). After 
that all unlogged tables remain completely unchanged (no 
DML-/DDL-Statements). Hence all of my huge unlogged, "static" tables get 
never "unclean" and should not be truncated after a server crash.

BTW, if I set all unlogged tables to logged after bulk load, it takes 
additional 1.5 hours, mainly because of re-indexing, I suppose. I assume 
that a restart of the database after a server crash takes another 1.5 
hours (reading from WAL) until the database is up and running.

Therefore I am seeking a strategy, to not tagging those tables as 
"unclean" and not truncating all unlogged tables on server restart.


Cheers and regards.




pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Why in pgAdmin an active session is marked/highlighted in Red
Next
From: "David G. Johnston"
Date:
Subject: Re: Are all unlogged tables in any case truncated after a server-crash?