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 1qIuNY-0003Qw-BZ for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 17:08:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qIuNW-0003RE-VD for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 17:08:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qIuNW-0003R5-Kp for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 17:08:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qIuNU-003JdO-0C for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 17:08:49 +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 36AH8j2a2241100; Mon, 10 Jul 2023 13:08:45 -0400 From: Tom Lane To: Ted Toth cc: "David G. Johnston" , pgsql-general@lists.postgresql.org Subject: Re: what causes new temp schemas to be created In-reply-to: References: Comments: In-reply-to Ted Toth message dated "Mon, 10 Jul 2023 12:03:01 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2241098.1689008925.1@sss.pgh.pa.us> Date: Mon, 10 Jul 2023 13:08:45 -0400 Message-ID: <2241099.1689008925@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ted Toth writes: > So it's an optimization to reuse existing but currently unused temp > schemas, correct? Exactly. We could just destroy and recreate the old temp schema, but that seems to lead to useless catalog churn. Instead we just destroy any old contents, if there's an existing temp schema in the slot assigned to the current backend. regards, tom lane