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 1o5lYz-000864-Bw for pgsql-general@arkaria.postgresql.org; Mon, 27 Jun 2022 10:01:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o5lYy-0002Q5-10 for pgsql-general@arkaria.postgresql.org; Mon, 27 Jun 2022 10:01:48 +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 1o5lYx-0002Pv-Jh for pgsql-general@lists.postgresql.org; Mon, 27 Jun 2022 10:01:47 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o5lYu-00034u-Qc for pgsql-general@lists.postgresql.org; Mon, 27 Jun 2022 10:01:46 +0000 Received: by mail-ej1-x636.google.com with SMTP id fi2so17982285ejb.9 for ; Mon, 27 Jun 2022 03:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=QBNIkFTocNspWRgQnkzJ2Kzo/RsnkI/PhIvylnudrVo=; b=rgQ7pSjb/MhqO5ky5M7thHmwGOB1bjU+ZFmTeXYSs/La5mtOVOSAKLlGV+ddRLvftc PU2kZdgGchR45JPOULR7mpj7u9L0M/u+4WIT/P59LXNnJ3CTlb1I8xFrs+2d5qn3W0cH n//NwnPcIX7IH94a97FrZN4j7Ut/hlA81W0ma3bW+aIzfbQk49hiGDD6G6wK/w7cxz78 h5cfy6DhhlYEK8HUb+lJa5WOLL77MhQHaW24p3c0QwXWvP1MUHOo/L8kH37XwUHLhWTa 2Q6FZ5IvXpRVGinYj0XlXnTcoMjywWGxr6zwnpQIIc/M1cfJyw52pM0Eqifj1Hy1bMu8 iNUw== 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:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=QBNIkFTocNspWRgQnkzJ2Kzo/RsnkI/PhIvylnudrVo=; b=0vyyMWJpTNYEqPvwvODXAZH7OCscI1XTlFaHY0sTwbOIg66/vm3WBBg29R6WNw1fCh f9ZW6hx8eUERXFDmg7ie2DcmGMcO0CAaz8KUdRTwX4M9jZHH+dJzEQRlzvrBMdMa1bWn wwTTXs+D5f/ZGKA5uRzxXyljukjWoWeOKxii/+kwyMuNGrv6epHa59raxXsm6J8jIkBf McFUGVDDWhtn7i5adi7NmnlaVk0+1oWAOoedI3l2Chaxn3fNL2viUVQesdu5RHrH56jn yKzHvsiFsAirpRxtHYitriqaTqZTkIzl6n0UzcTBiL5yRbRbLKfDKfBo/6Cbna6A8n9s MgKg== X-Gm-Message-State: AJIora9Q1Ivtc/WBm0ywrk1rpiFm/s3LN54NKmzw1PwQfmhLXuR7jclU XF4qVq1dA7QJYP0yuvn2uqmlqg== X-Google-Smtp-Source: AGRyM1sR8DhkemrzT3k0XZZ1L75z1HbL4WqnHvMAn57SZWWesCV/HW7UraMP3qqU83+Atar7nwzlUw== X-Received: by 2002:a17:906:3694:b0:726:b4e7:774 with SMTP id a20-20020a170906369400b00726b4e70774mr1885228ejc.99.1656324102495; Mon, 27 Jun 2022 03:01:42 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:5151:6f59:646:3c67:1109]) by smtp.gmail.com with ESMTPSA id s12-20020a1709064d8c00b006fe8ec44461sm4824329eju.101.2022.06.27.03.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 03:01:42 -0700 (PDT) Message-ID: Subject: Re: Table space not returned to the OS ? From: Laurenz Albe To: Magnus Hagander , Florents Tselai Cc: pgsql-general Date: Mon, 27 Jun 2022 12:01:41 +0200 In-Reply-To: References: <35BEB990-A045-413D-8F0F-EA372754960C@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) 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 Mon, 2022-06-27 at 11:38 +0200, Magnus Hagander wrote: > On Mon, Jun 27, 2022 at 11:30 AM Florents Tselai wrote: > > A few months back (October) I had upgraded a Postgres instance from v12 —> 14. > > > > The database disk size under /var/lib/postgresql/12 was around 800GB+ back then. > > Note, that IIRC I had used hard-linking during the upgrade. > > > > As I was running out of disk space, I started investigating and found out that > > > > /var/lib/postgresql/12/main/base/16385  —>  886GB+ > > /var/lib/postgresql/14 —> 400GB > > It looks like you didn't actually delete the old cluster, which you are supposed > to do once you have verified that the new one works. I think that it should be done earlier than that, namely immediately after running pg_upgrade. Once you have started the PostgreSQL 14 server (to verify that it works), you can no longer use the old cluster. Yes, the control file is crippled, but in my opinion, the earlier you delete the old cluster, the safer. Yours, Laurenz Albe