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 1m2xcN-0005wq-BV for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 15:13:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2xcL-0005XJ-3E for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 15:13:09 +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 1m2xcK-0005Ww-Qa for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 15:13:08 +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 1m2xcI-0000NR-TS for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 15:13:07 +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 16CFD4Yw2949872; Mon, 12 Jul 2021 11:13:04 -0400 From: Tom Lane To: "Phil Endecott" cc: pgsql-general@lists.postgresql.org Subject: Re: Why can't I drop a tablespace? In-reply-to: <1626097395360@dmwebmail.dmwebmail.chezphil.org> References: <1626097395360@dmwebmail.dmwebmail.chezphil.org> Comments: In-reply-to "Phil Endecott" message dated "Mon, 12 Jul 2021 14:43:15 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2949870.1626102784.1@sss.pgh.pa.us> Date: Mon, 12 Jul 2021 11:13:04 -0400 Message-ID: <2949871.1626102784@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Phil Endecott" writes: > Thanks Laurenz. I was looking at the source for "alter table set > tablespace" yesterday trying to work out what is supposed to happen. > There is a comment at tablecmds.c line 3989: "Thanks to the magic of > MVCC, an error anywhere along the way rolls back the whole operation; > we don't have to do anything special to clean up." But I guess that > creating an entirely new file on a different filesystem is an > exception to that. No, but PANIC'ing during commit is :-(. Ordinarily the files created by a failed transaction would be removed during transaction cleanup, but we did not reach that code. So these were left behind, but the table's original files in the original tablespace should be undamaged. regards, tom lane