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 1uuXHE-00C0UW-N3 for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Sep 2025 14:18:57 +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 1uuXHD-0083JC-6x for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Sep 2025 14:18:55 +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 1uuXHC-0083IO-UQ for pgsql-bugs@lists.postgresql.org; Fri, 05 Sep 2025 14:18:55 +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 1uuXH9-000izj-2j for pgsql-bugs@lists.postgresql.org; Fri, 05 Sep 2025 14:18:55 +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 585EIjoQ1365204; Fri, 5 Sep 2025 10:18:45 -0400 From: Tom Lane To: Laurenz Albe cc: Yushu Chen , katja.henke@foo.ag, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own In-reply-to: <8dec121e2d3bfc1149d36359345fbce1faa087aa.camel@cybertec.at> References: <19034-de0857b4f94ec10c@postgresql.org> <1030106.1756999498@sss.pgh.pa.us> <8dec121e2d3bfc1149d36359345fbce1faa087aa.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Fri, 05 Sep 2025 14:17:33 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1365202.1757081925.1@sss.pgh.pa.us> Date: Fri, 05 Sep 2025 10:18:45 -0400 Message-ID: <1365203.1757081925@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Thu, 2025-09-04 at 11:24 -0400, Tom Lane wrote: >> Given that recursive SQL functions are a tiny-minority use case >> and there's already a perfectly serviceable way to make them >> (ie use an old-style body), I seriously doubt that we'll do >> anything about this request. > Sure, but creating a dump that will fail to load is not good. Oh, if you are defining the problem as "pg_dump doesn't cope after I make this function in two steps" rather than "the server should allow this to be done in one step", that seems more defensible. One could expect that that'd let pg_dump also cope with cases involving mutual recursion between two or more such functions, which is something we'd certainly not try to make the server allow without help. regards, tom lane