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 1jqLM7-0007mm-Sp for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jun 2020 18:51:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jqLM6-0007Re-Ob for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jun 2020 18:51:42 +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 1jqLM6-0007RX-He for pgsql-hackers@lists.postgresql.org; Tue, 30 Jun 2020 18:51:42 +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 1jqLM4-0000gu-HX for pgsql-hackers@postgresql.org; Tue, 30 Jun 2020 18:51:41 +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 05UIpcDJ494839; Tue, 30 Jun 2020 14:51:38 -0400 From: Tom Lane To: Robert Haas cc: Peter Eisentraut , pgsql-hackers Subject: Re: SQL-standard function body In-reply-to: <493812.1593541480@sss.pgh.pa.us> References: <1c11f1eb-f00c-43b7-799d-2d44132c02d7@2ndquadrant.com> <493812.1593541480@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 30 Jun 2020 14:24:40 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <494837.1593543098.1@sss.pgh.pa.us> Date: Tue, 30 Jun 2020 14:51:38 -0400 Message-ID: <494838.1593543098@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Replicating the creation-time search path will be a big headache for > pg_dump, I bet. On further thought, we probably don't have to. Re-parsing the function body the same way is exactly the same problem as re-parsing a view or matview body the same way. I don't want to claim that that's a 100% solved problem, but I've heard few complaints in that area lately. The point remains that exposing the function body's dependencies will constrain restore order far more than we are accustomed to see. It might be possible to build examples that flat out can't be restored, even granting that we teach pg_dump how to break dependency loops by first creating the function with empty body and later redefining it with the real body. (Admittedly, if that's possible then you likely could make it happen with views too. But somehow it seems more likely that people would create spaghetti dependencies for functions than views.) regards, tom lane