Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlVH1-0000EE-Ng for pgsql-general@arkaria.postgresql.org; Fri, 12 Nov 2021 12:03:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mlVH0-0005qf-Js for pgsql-general@arkaria.postgresql.org; Fri, 12 Nov 2021 12:03:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlVH0-0005qU-88 for pgsql-general@lists.postgresql.org; Fri, 12 Nov 2021 12:03:14 +0000 Received: from mout01.posteo.de ([185.67.36.65]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlVGx-0006xt-BL for pgsql-general@postgresql.org; Fri, 12 Nov 2021 12:03:13 +0000 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id EA1B124002B for ; Fri, 12 Nov 2021 13:03:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1636718588; bh=uVTZdbLUKJaSypMgtI1VqXAT7cwiP4EmTD2PDbxJIE0=; h=Date:Subject:To:From:From; b=CWQ97EhlFC3pdYaPaiFuwmdFMKfnKyf49HDkcR4jV4Jh3COj7blWqGVQ1RSchDE8n oCyPgFw49GH2LLYgvmS4MTrePmyWhtKgxXLQrXQmq2Fdc1DX2s7cmw9KOiNqiKvEvf OrhK//cQHkA+RX0BK9ZzhU9w4wK7WUDxwidPBCaTF4hd6WQ2eHA5KYgpjRa03coLSk 1AzJFO5XfrPNxEJ7rwsyJS/N9YH1w0yAC4M07vZxUwduhK4Bh0o+UcD6aANUlxxzLl iBO0GxL1OZFroGzo52NvXsv2JqIwZuqXS6aTdMTk20UfP6n+mVA+SRNw3mhJL4PLtu rJLWHo9s+xK+g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HrHKS048Rz6tpZ; Fri, 12 Nov 2021 13:03:07 +0100 (CET) Message-ID: <41f67000-8ddc-a9ab-c6af-097af084498d@posteo.de> Date: Fri, 12 Nov 2021 12:03:07 +0000 MIME-Version: 1.0 Subject: Re: Are all unlogged tables in any case truncated after a server-crash? Content-Language: en-GB To: Laurenz Albe , pgsql-general@postgresql.org References: <371166df102667898df3be4be0e4e07c992f0093.camel@cybertec.at> From: sch8el@posteo.de In-Reply-To: <371166df102667898df3be4be0e4e07c992f0093.camel@cybertec.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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