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 1v561L-001Hdr-9q for pgsql-bugs@arkaria.postgresql.org; Sat, 04 Oct 2025 17:26: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 1v561J-000bM4-4a for pgsql-bugs@arkaria.postgresql.org; Sat, 04 Oct 2025 17:26:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v561I-000bLi-SN for pgsql-bugs@lists.postgresql.org; Sat, 04 Oct 2025 17:26:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v561C-000OAX-1J for pgsql-bugs@lists.postgresql.org; Sat, 04 Oct 2025 17:26:04 +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 594HQ0E51526599; Sat, 4 Oct 2025 13:26:00 -0400 From: Tom Lane To: bernice.southey@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19072: New-style SQL language function referencing a temp table behaves oddly In-reply-to: <19072-819bab455efebdd7@postgresql.org> References: <19072-819bab455efebdd7@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 04 Oct 2025 16:51:33 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1526597.1759598760.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 04 Oct 2025 13:26:00 -0400 Message-ID: <1526598.1759598760@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: > When created in psql, a new-style SQL language function referencing a te= mp > table disappears with the session, as if it were a temporary function. Yeah, this is expected, since the parser will create a pg_depend linkage from the function to the temp table. > When created in pgAdmin, the function survives. Really? I don't use pgAdmin, but I don't see how it could affect the object dependency rules. Perhaps it's not closing the originating session when you think it is? There is a nearby thread proposing forbidding new-style functions from having dependencies on temp objects [1]. Curious to know if you think that'd be a good answer. regards, tom lane [1] https://www.postgresql.org/message-id/flat/19cf6ae1-04cd-422c-a760-d7e= 75fe6cba9%40uni-muenster.de