Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUT0J-003EtM-VB for pgsql-admin@arkaria.postgresql.org; Thu, 18 Jul 2024 15:25:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sUT0H-000M1x-3L for pgsql-admin@arkaria.postgresql.org; Thu, 18 Jul 2024 15:25:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUT0G-000M1p-HE for pgsql-admin@lists.postgresql.org; Thu, 18 Jul 2024 15:25:09 +0000 Received: from mail2.pscs.co.uk ([178.159.10.131] helo=mail.pscs.co.uk) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUT0D-000DAF-Du for pgsql-admin@lists.postgresql.org; Thu, 18 Jul 2024 15:25:07 +0000 Authentication-Results: mail.pscs.co.uk; spf=none; auth=pass (cram-md5) smtp.auth=pscs Received: from lmail.pscs.co.uk ([192.168.120.1]) by mail.pscs.co.uk ([192.168.120.185] running VPOP3) with ESMTPSA (TLSv1.3 TLS_AES_256_GCM_SHA384) for ; Thu, 18 Jul 2024 16:25:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pscs.co.uk; q=dns/txt; s=lmail; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To :Content-Type:Content-Transfer-Encoding:Cc:Reply-to:Sender; t=1721315973; x=1721920773; bh=4CdlVBiJFC03H/TqLyHUKHTSnO8FDOMSXshiaBzW0lA=; b=pOO95PVCgBVEJPtiH3Jzyl/nvbsUPfu8KPylLG/TJCmthhz9wMSaMdJuwRwLiPDPw9885NT2 JO7NIB0YJti/kHTgI/kg1PB19kWdBBkkebqfS8EnMpkjqCXKbXb3kZ7V+phmA3xChn98z3GYyr XH9NVVEUsVW8gjNPEDryyaogo= Authentication-Results: lmail.pscs.co.uk; spf=none; auth=pass (cram-md5) smtp.auth=paul Received: from [192.168.57.71] ([217.155.111.120] (217-155-111-120.dsl.in-addr.zen.co.uk)) by lmail.pscs.co.uk ([192.168.120.70] running VPOP3) with ESMTPSA (TLSv1.3 TLS_AES_256_GCM_SHA384) for ; Thu, 18 Jul 2024 16:19:32 +0100 Message-ID: Date: Thu, 18 Jul 2024 16:19:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: filesystem full during vacuum - space recovery issues Content-Language: en-GB To: pgsql-admin@lists.postgresql.org References: From: Paul Smith* In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: paul X-Server: VPOP3 Enterprise V8.5 - Registered X-Organisation: Paul Smith Computer Services X-VPOP3Tester: 12 345 X-Authenticated-Sender: pscs List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 15/07/2024 19:47, Thomas Simpson wrote: > > My problem now is how do I get this space back to return my free space > back to where it should be? > > I tried some scripts to map the data files to relations but this > didn't work as removing some files led to startup failure despite them > appearing to be unrelated to anything in the database - I had to put > them back and then startup worked. > I don't know what you tried to do What would normally happen on a failed VACUUM FULL that fills up the disk so the server crashes is that there are loads of data files containing the partially rebuilt table. Nothing 'internal' to PostgreSQL will point to those files as the internal pointers all change to the new table in an ACID way, so you should be able to delete them. You can usually find these relatively easily by looking in the relevant tablespace directory for the base filename for a new huge table (lots and lots of files with the same base name - eg looking for files called *.1000 will find you base filenames for relations over about 1TB) and checking to see if pg_filenode_relation() can't turn the filenode into a relation. If that's the case that they're not currently in use for a relation, then you should be able to just delete all those files Is this what you tried, or did your 'script to map data files to relations' do something else? You were a bit ambiguous about that part of things. Paul