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 1lWVw1-0003lu-Hd for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Apr 2021 03:11:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lWVw0-0006Z9-FP for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Apr 2021 03:11:20 +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 1lWVw0-0006Z1-91 for pgsql-hackers@lists.postgresql.org; Wed, 14 Apr 2021 03:11:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWVvy-00027Q-0K for pgsql-hackers@lists.postgresql.org; Wed, 14 Apr 2021 03:11:19 +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 13E3BDEM3441173; Tue, 13 Apr 2021 23:11:13 -0400 From: Tom Lane To: Noah Misch cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut Subject: Re: Converting contrib SQL functions to new style In-reply-to: <20210414020827.GA1232417@rfd.leadboat.com> References: <3395418.1618352794@sss.pgh.pa.us> <20210414020827.GA1232417@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Tue, 13 Apr 2021 19:08:27 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3441171.1618369873.1@sss.pgh.pa.us> Date: Tue, 13 Apr 2021 23:11:13 -0400 Message-ID: <3441172.1618369873@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Noah Misch writes: > On Tue, Apr 13, 2021 at 06:26:34PM -0400, Tom Lane wrote: >> Attached are some draft patches to convert almost all of the >> contrib modules' SQL functions to use SQL-standard function bodies. >> The point of this is to remove the residual search_path security >> hazards that we couldn't fix in commits 7eeb1d986 et al. Since >> a SQL-style function body is fully parsed at creation time, >> its object references are not subject to capture by the run-time >> search path. > Are there any inexact matches in those function/operator calls? Will that > matter more or less than it does today? I can't claim to have looked closely for inexact matches. It should matter less than today, since there's a hazard only during creation (with a somewhat-controlled search path) and not during use. But that doesn't automatically eliminate the issue. >> I'd like to propose squeezing these changes into v14, even though >> we're past feature freeze. Reason one is that this is less a >> new feature than a security fix; reason two is that this provides >> some non-artificial test coverage for the SQL-function-body feature. > Dogfooding like this is good. What about the SQL-language functions that > initdb creates? Hadn't thought about those, but converting them seems like a good idea. regards, tom lane