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 1t8UUB-004XKc-8C for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Nov 2024 01:05:26 +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 1t8UU8-002KyZ-2f for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Nov 2024 01:05:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8UU7-002KyR-Oy for pgsql-hackers@lists.postgresql.org; Wed, 06 Nov 2024 01:05:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8UU5-000OE7-Bi for pgsql-hackers@lists.postgresql.org; Wed, 06 Nov 2024 01:05:22 +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 4A615GJX3133934; Tue, 5 Nov 2024 20:05:16 -0500 From: Tom Lane To: Michael Paquier cc: Ronan Dunklau , pgsql-hackers@lists.postgresql.org, Peter Eisentraut Subject: Re: Converting contrib SQL functions to new style In-reply-to: References: <3395418.1618352794@sss.pgh.pa.us> <3316564.aeNJFYEL58@aivenlaptop> <2650823.1730736601@sss.pgh.pa.us> <1901969.tdWV9SEqCh@aivenlaptop> Comments: In-reply-to Michael Paquier message dated "Wed, 06 Nov 2024 09:51:09 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3133932.1730855116.1@sss.pgh.pa.us> Date: Tue, 05 Nov 2024 20:05:16 -0500 Message-ID: <3133933.1730855116@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > I was wondering what was going on here, and this patch comes down to > switching all these definitions from that: > CREATE FUNCTION lo_oid(lo) RETURNS pg_catalog.oid AS > 'SELECT $1::pg_catalog.oid' LANGUAGE SQL STRICT IMMUTABLE PARALLEL SAFE; > To that: > +CREATE OR REPLACE FUNCTION lo_oid(lo) RETURNS pg_catalog.oid > +LANGUAGE SQL STRICT IMMUTABLE PARALLEL SAFE > +RETURN (SELECT $1::pg_catalog.oid); Right. > This makes the executions more robust run-time search_path checks. Is > that something that should be considered for a backpatch, actually? No, I don't think so. For one thing, it would not help existing installations unless they issue "ALTER EXTENSION UPDATE", which people are not likely to do in a minor update. But also, we don't know of live attacks against these functions with their current definitions, so I don't think this is urgent. regards, tom lane