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 1rBF3v-00A46S-SD for pgsql-general@arkaria.postgresql.org; Thu, 07 Dec 2023 14:09:11 +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 1rBF3u-000WTu-GW for pgsql-general@arkaria.postgresql.org; Thu, 07 Dec 2023 14:09:10 +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 1rBF3u-000WQn-5A for pgsql-general@lists.postgresql.org; Thu, 07 Dec 2023 14:09:10 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBF3r-009Fxz-FL for pgsql-general@lists.postgresql.org; Thu, 07 Dec 2023 14:09:08 +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 3B7E95K61265148; Thu, 7 Dec 2023 09:09:05 -0500 From: Tom Lane To: Vishwanath Kummera cc: pgsql-general@lists.postgresql.org Subject: Re: Postgresql : pg_temp & pg_toast_temp In-reply-to: References: Comments: In-reply-to Vishwanath Kummera message dated "Thu, 07 Dec 2023 00:12:00 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1265146.1701958145.1@sss.pgh.pa.us> Date: Thu, 07 Dec 2023 09:09:05 -0500 Message-ID: <1265147.1701958145@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vishwanath Kummera writes: > I am seeing there are many schemas created, this is specially when > enabled "CONCURRENTLY" option for refreshing materialized views through > table trigger. > pg_temp_1... pg_temp_30 > pg_toast_temp_1... pg_toast_temp_30 Yes, that's by design. There's a separate temp schema for each backend session "slot", which gets created when first needed. > If this is by design the temp schemas get created with the "CONCURRENTLY" > option, is there any way to clean-up them automatically? No. It'd just lead to thrashing/bloat in the pg_namespace catalog, since they'd be needed again eventually. regards, tom lane > Thanks, > Vishu