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 1tAqtu-000Ryq-3K for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 13:25:45 +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 1tAqtq-006N3i-2W for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 13:25:42 +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 1tAqto-006N3Y-5B for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 13:25:42 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAqtj-001XkV-LQ for pgsql-hackers@postgresql.org; Tue, 12 Nov 2024 13:25:39 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id 1D4951140191; Tue, 12 Nov 2024 08:25:34 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Tue, 12 Nov 2024 08:25:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1731417933; x=1731504333; bh=bPVNUQfs9P4f2daxgBsBrv2CUW5XAUqZ LnaDBkejRHI=; b=FmVZC9/VwFW6D60TpAmjB418rUPe414eLJ+j9oYp8pRdGs/E YQLwfJh6owDZOqgkLCWU3gH3LwtaQeh5zDD3gGgFexR45RrfQS4dgUp5cUsGnRdd 32M2cwSKdZMHVX4vYA7XFIJZ5phRIxHD32Fe+p3XDjeV6Qf3LZL+tzDzmC7B6iAI MXdGQX1uw6fDz9TQYQzURR8ig1iaR4n1/P19dVKxtSorLJSKV0ZtyT/7VdYYvazA kJ95R1w6SpNBK3s1gJH9lQ5qffp/X5Kfb0QlypCNOtdIUfrN8ockwfvH0i9WVhOS 7aazP8rmrlusTPj8qhxPA9cE/w6JHb1hEcbeVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1731417933; x= 1731504333; bh=bPVNUQfs9P4f2daxgBsBrv2CUW5XAUqZLnaDBkejRHI=; b=E JQNCspjaKKOdNapMNbGkkhdOppk2lvuW1VBILwGMRHBZAU15zun+sz34H8x9ENnE sAAVDfoDJR1fV5GmJHxUO2iCMHLFxc2j9UXSom3pTPOuk0uo0HinWsaCTL3ed1nP zI50+k1YNqT1sUwmz03Gb/lyezRGxBIIX2E2uQENlxtXicJuVDoAIJTgwKYs19il Lvqt/jfUmExObU7r/1x6eeeVpi5I8OQhfEI1MabnqunksWQyaYG+03Gut7JszoIp nfwB+uYcKtyGp9duX2Z6GqSbLN5MFuoM+bgSowERluBgzhYFvE0liOxc9rdr63O8 76h7Zl9RQCF15oJgPdbzw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeen ucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnh htrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfevhedttefgfffhhfeffefg gffhffelgfeiueeukeehvdehvdefheffvdefueenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhr ghdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepug grvhhiugesjhhushhtrghthhgvohhrhidrtghomhdprhgtphhtthhopegtrhgrihhgrdhr ihhnghgvrhesvghnthgvrhhprhhishgvuggsrdgtohhmpdhrtghpthhtohepghgrsghrih gvlhgvrdgsrghrthholhhinhhisegvnhhtvghrphhrihhsvggusgdrtghomhdprhgtphht thhopehrohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghlvh hhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdprhgtphhtthhopehpghhsqhhlqdhh rggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Nov 2024 08:25:32 -0500 (EST) Message-ID: <04235387-120e-4bf6-b5c8-645d869222b9@eisentraut.org> Date: Tue, 12 Nov 2024 14:25:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RFC: Additional Directory for Extensions To: "David E. Wheeler" Cc: Craig Ringer , Gabriele Bartolini , Robert Haas , Alvaro Herrera , PostgreSQL-development References: <202406251012.brdp2dobkf7n@alvherre.pgsql> <0d384836-7e6e-4932-af3b-8dad1f6fee43@eisentraut.org> <0D89C6B2-F294-4389-9DDA-07C381995292@justatheory.com> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <0D89C6B2-F294-4389-9DDA-07C381995292@justatheory.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11.11.24 19:15, David E. Wheeler wrote: >> In fact, most of the patch is refactoring the routines in dfmgr.c to not hardcode dynamic_library_path but allow searching for any file in any path. Once a control file is found, the other extension support files (script files and auxiliary control files) are looked for in the same directory. > > What about shared libraries files? Nothing changes about shared library files. They are looked up in dynamic_library_path or any hardcoded file name. >> This works pretty much fine for the use cases that have been presented here, including installing extensions outside of the core installation tree (for CNPG and Postgres.app) and for testing uninstalled extensions (for Debian). > > If I understand correctly, shared modules still lie in dynamic_library_path, yes? That makes things a bit more complicated, as the CNPG use case has to set up multiple persistent volumes to persist files put into various directories, notably sharedir and pkglibdir. No, you can also install them into a common directory and mount that one. For example, you install the extension at build time into /tmp/foo/{lib,share/extension}, you package that up as a disk image, mount it at /opt/extensions/myext, and then you can point extension_control_path at /opt/extensions/myext/lib and dynamic_library_path at /opt/extensions/myext/share/extension. >> - The biggest problem is that many extensions set in their control file >> >> module_pathname = '$libdir/foo' >> >> This disables the use of dynamic_library_path, so this whole idea of installing an extension elsewhere won't work that way. The obvious solution is that extensions change this to just 'foo'. But this will require a lot updating work for many extensions, or a lot of patching by packagers. > > Since that’s set at build/install time, couldn’t the definition of `$libdir` here be changed to mean “the directory into which it’s being installed right now?”. Doesn’t seem necessary to search a path if the specific location is set at install time. No, this is not set at build or install time. This is for typical extensions hardcoded, and $libdir is resolved by the PostgreSQL server at run time. > Perhaps I misunderstand, but I would like to talk through the implications of a more radical rethinking of extension file location along the lines of the other thread[2] and the RFC I’m working up based on them both[1], especially since there are a few other use cases that inform it. I'm aware of that thread, but I think that is looking like a much larger project than what I'm proposing here.