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 1oJk2q-00053Z-Fo for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2022 23:14:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oJk2p-0001CL-Bo for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2022 23:14:23 +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 1oJk2p-0001AC-2T for pgsql-hackers@lists.postgresql.org; Thu, 04 Aug 2022 23:14:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJk2m-0000bC-Up for pgsql-hackers@lists.postgresql.org; Thu, 04 Aug 2022 23:14:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 274NE8593681810; Thu, 4 Aug 2022 19:14:08 -0400 From: Tom Lane To: Andres Freund cc: Dilip Kumar , Justin Pryzby , Robert Haas , Ashutosh Sharma , Maciek Sakrejda , Bruce Momjian , Alvaro Herrera , Andrew Dunstan , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints In-reply-to: <20220804225147.ypcpujdcouhmkggz@awork3.anarazel.de> References: <20220803160200.GD19644@telsasoft.com> <20220803170118.GG19644@telsasoft.com> <20220803182643.a6r2t2jyo5zxx767@awork3.anarazel.de> <20220803184857.GI19644@telsasoft.com> <20220804214613.attcw2kktjz2z272@awork3.anarazel.de> <3664321.1659650725@sss.pgh.pa.us> <20220804225147.ypcpujdcouhmkggz@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 04 Aug 2022 15:51:47 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3681808.1659654848.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 04 Aug 2022 19:14:08 -0400 Message-ID: <3681809.1659654848@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-08-04 18:05:25 -0400, Tom Lane wrote: >> In any case, DROP DATABASE is far from the only place with a problem. > What other place has a database corrupting potential of this magnitude j= ust > because interrupts are accepted? We throw valid s_b contents away and t= hen > accept interrupts before committing - with predictable results. We also = accept > interrupts as part of deleting the db data dir (due to catalog access). Those things would be better handled by moving the data-discarding steps to post-commit. Maybe that argues for having an internal commit halfway through DROP DATABASE: remove pg_database row, commit, start new transaction, clean up. regards, tom lane