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 1mlRC8-0005Xg-26 for pgsql-general@arkaria.postgresql.org; Fri, 12 Nov 2021 07:41:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mlRC7-0008Fe-1V for pgsql-general@arkaria.postgresql.org; Fri, 12 Nov 2021 07:41:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlRC6-0008FV-JC for pgsql-general@lists.postgresql.org; Fri, 12 Nov 2021 07:41:54 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mlRC3-000051-Gw for pgsql-general@postgresql.org; Fri, 12 Nov 2021 07:41:53 +0000 Received: by mail-wr1-x431.google.com with SMTP id i5so14035918wrb.2 for ; Thu, 11 Nov 2021 23:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=IWm6a63OJdJWdxJK4Bnj1MSFBjUmOFa0YJBHldU9ZMA=; b=s1HLhDaigbtaWj7M1WLSmSEFnREwF4XtomOAy0EtUK/z0XcXRsGhCUhLErJ2SO4aQ1 TyxKAfd/NXyYci1VH1m7c+Guxe6A8HrAlU3p21MPdA4fe9+LjsBTIVLLASwHCPv5MBV6 M4FOInbgF2cIPUQpRhoeHUIeDFIXabSRvVO24L9PbW9VJop6F3gRUN+8c1lLSyJYoY+e slv+tdvTSbpGUOaqqMMN4Y8j9p/RXSQ4bjPBQSJrsj+Uub/SuG/ynskbbmB9i5/Fvw/A 6qWzLD07zAvYDWirwtY9TtRp7y6+dmEJcaQhPpjSJcdA4dKyr+M1avJLmQYYPrx0S6Jf yFqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=IWm6a63OJdJWdxJK4Bnj1MSFBjUmOFa0YJBHldU9ZMA=; b=ciAGY5MKwDsoMUwIi+A1YAW7Is8MyZcJ+K8zeJudbEt9mjmfU0TiNCCRtwKIct8VEB FD4cSxJh4CVMDp2bozpRCU5h2KpPyVwe8r2bVUuvHsg6PQR3SGLfDsys9QP3dn1z/IIt C1Q7OH+SegYNxdJ7so7AjalzZ2vgwMfZ33StRrmQUWmiN7HSYwaWsHWnDEH7F5to2itj JUZ54V+og/4J8bWpEoCH4frp8rUJUIpZ3G/RNWWJlS2q0b/Ek8NdU4R6BIDxRrjbEfwR tFsv6wliUgZ9obFO+OnMKZL2QvTvFXXZQ/et+eowFNlHonbcuv31W14tQN7ImYhFMtQG d+sw== X-Gm-Message-State: AOAM532nrWNfEq1UXv+KM8ayH9WumwbUdQa+UjCDeCdDE7aPRpcjskhb Urbcfuo+eGto2khykYclg+2bwPjZpc2saA== X-Google-Smtp-Source: ABdhPJyMs7IS5Ymmm8cZ/LWaAvFm7CSGvdnGTG05WIHehT/8ikVLk4XrzQgTe00NRlQMBQI+RNTt4Q== X-Received: by 2002:adf:e742:: with SMTP id c2mr15752333wrn.232.1636702909815; Thu, 11 Nov 2021 23:41:49 -0800 (PST) Received: from localhost.localdomain (62-47-148-19.adsl.highway.telekom.at. [62.47.148.19]) by smtp.gmail.com with ESMTPSA id a10sm7089347wmq.27.2021.11.11.23.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 23:41:49 -0800 (PST) Message-ID: <371166df102667898df3be4be0e4e07c992f0093.camel@cybertec.at> Subject: Re: Are all unlogged tables in any case truncated after a server-crash? From: Laurenz Albe To: sch8el@posteo.de, pgsql-general@postgresql.org Date: Fri, 12 Nov 2021 08:41:48 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com