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 1p5jyt-0002ai-FD for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 08:52: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 1p5jyr-0001Er-Ug for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 08:52:41 +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 1p5jyr-0001Ei-LY for pgsql-hackers@lists.postgresql.org; Thu, 15 Dec 2022 08:52:41 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5jyp-0003E1-Gv for pgsql-hackers@postgresql.org; Thu, 15 Dec 2022 08:52:41 +0000 Received: (Authenticated sender: strk@kbt.io) by mail.gandi.net (Postfix) with ESMTPSA id B59AA100002; Thu, 15 Dec 2022 08:52:36 +0000 (UTC) Date: Thu, 15 Dec 2022 09:52:34 +0100 From: Sandro Santilli Sender: strk@kbt.io To: Regina Obe Cc: 'Tom Lane' , pgsql-hackers@postgresql.org Subject: Re: Ability to reference other extensions by schema in extension scripts Message-ID: <20221215085234.rpjzlm7hmsmbanqv@c19> Mail-Followup-To: Sandro Santilli , Regina Obe , 'Tom Lane' , pgsql-hackers@postgresql.org References: <003001d8f4ae$402282c0$c0678840$@pcorp.us> <79300.1668052170@sss.pgh.pa.us> <004501d8f4bf$1213fba0$363bf2e0$@pcorp.us> <175298.1668101858@sss.pgh.pa.us> <004b01d8fef3$752dbf30$5f893d90$@pcorp.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004b01d8fef3$752dbf30$5f893d90$@pcorp.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Nov 22, 2022 at 11:24:19PM -0500, Regina Obe wrote: > Here is first version of my patch using the @extschema:extensionname@ syntax > you proposed. > > This patch includes: > 1) Changes to replace references of @extschema:extensionname@ with the > schema of the required extension > 2) Documentation for the feature > 3) Tests for the feature. > > There is one issue I thought about that is not addressed by this. > > If an extension is required by another extension and that required extension > schema is referenced in the extension scripts using the > @extschema:extensionname@ syntax, then ideally we should prevent the > required extension from being relocatable. This would prevent a user from > accidentally moving the required extension, thus breaking the dependent > extensions. > > I didn't add that feature cause I wasn't sure if it was overstepping the > bounds of what should be done, or if we leave it up to the user to just know > better. An alternative would be to forbid using @extschema:extensionname@ to reference relocatable extensions. DBA can toggle relocatability of an extension to allow it to be referenced. --strk;