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 1os5Bs-0008AX-Vm for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Nov 2022 16:41:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1os5Br-0008UE-Oj for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Nov 2022 16:41:39 +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 1os5Br-0008U5-Gg for pgsql-bugs@lists.postgresql.org; Mon, 07 Nov 2022 16:41:39 +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 1os5Bp-0002yW-BY for pgsql-bugs@lists.postgresql.org; Mon, 07 Nov 2022 16:41:38 +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 2A7GfZ043307284; Mon, 7 Nov 2022 11:41:36 -0500 From: Tom Lane To: balazs@obiserver.hu cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17679: REFRESH MATERIALIZED VIEW CONCURRENTLY leaves temporary files? In-reply-to: <17679-1095d04450cf6a6e@postgresql.org> References: <17679-1095d04450cf6a6e@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 06 Nov 2022 23:09:56 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3307282.1667839295.1@sss.pgh.pa.us> Date: Mon, 07 Nov 2022 11:41:35 -0500 Message-ID: <3307283.1667839295@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > After we upgraded from 14 to 15, the occupied space keeps decreasing. > The following files can be found in the subdirectory of the database: ( > /var/lib/postgresql/15/main/base/16457 ) > ... > -rw-------. 1 postgres postgres 210903040 Nov 6 10:37 t8_4372109.1 > -rw-------. 1 postgres postgres 1073741824 Nov 6 14:43 t8_4375122.1 > -rw-------. 1 postgres postgres 1073741824 Nov 6 14:43 t8_4375122.2 > -rw-------. 1 postgres postgres 434585600 Nov 6 14:43 t8_4375122.3 Thanks for the report! Actually it's even worse: v15 will leak non-first segments of any temporary tables, not just those made during REFRESH MATERIALIZED VIEW CONCURRENTLY. I've pushed a fix that will appear in 15.1. In the meantime, you should manually delete any files named according to the tNN_NNNN.N pattern that are clearly too old to belong to any live session. regards, tom lane