From: sch8el@posteo.de
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general@postgresql.org
Subject: Re: Are all unlogged tables in any case truncated after a server-crash?
Date: Fri, 12 Nov 2021 12:03:07 +0000
Message-ID: <41f67000-8ddc-a9ab-c6af-097af084498d@posteo.de> (raw)
In-Reply-To: <371166df102667898df3be4be0e4e07c992f0093.camel@cybertec.at>
References: <c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de>
<371166df102667898df3be4be0e4e07c992f0093.camel@cybertec.at>
Am 12.11.2021 um 08:41 schrieb Laurenz Albe:
> On Thu, 2021-11-11 at 18:39 +0000, sch8el@posteo.de wrote:
>> 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.
> There is no way to achieve that.
>
> But you could keep the "huge data sets" around and load them again if
> your server happens to crash (which doesn't happen often, I hope).
Thx Laurenz for yr reply! Yes, that's what we did after server crashes
(~ 2/yr on different locations).
But the system is at least 5 hours offline plus the time until the admin
manually re-starts the bulk loads. On my system, I have 6 databases
configured like this. For all I have to redo the bulk loads.
I hoped there was a 'switch' on crash-recovery, to avoid truncating the
datafiles of these unlogged tables, which are definitely in a perfect
condition.
Mart
>
> Yours,
> Laurenz Albe
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: sch8el@posteo.de, laurenz.albe@cybertec.at
Subject: Re: Are all unlogged tables in any case truncated after a server-crash?
In-Reply-To: <41f67000-8ddc-a9ab-c6af-097af084498d@posteo.de>
References: <c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de> <371166df102667898df3be4be0e4e07c992f0093.camel@cybertec.at> <41f67000-8ddc-a9ab-c6af-097af084498d@posteo.de>
* 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