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 1tAs8i-000Z5q-Jk for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 14:45:08 +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 1tAs8f-0075sC-Hq for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 14:45:06 +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 1tAs8e-0075s4-Gx for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 14:45:05 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAs8Z-001YKt-Bt for pgsql-hackers@postgresql.org; Tue, 12 Nov 2024 14:45:04 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id B460C1140198; Tue, 12 Nov 2024 09:44:56 -0500 (EST) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-11.internal (MEProxy); Tue, 12 Nov 2024 09:44:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=justatheory.com; 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= 2016-12.pbsmtp; t=1731422696; x=1731509096; bh=f7Ois/T7L8ATxPKTs jcBzS7NAW0TZ02ZTxAqXda1k90=; b=Ax/o2x+mT63FK+YheJ2GsmHPOLBK8qAmB WoTjiy/GQx1nJiEFl3u9K1wlHSpfTtHfq8gpoeY+Dz7CZtXT/3c26UFBbJYXwC/E AnlhPt3VCf1LINCmbxispt5C5uVQdS9scArCZ+dEuvJYO/4DEXkn3mnxMIVN2MnG AKbDw5xITQ= 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=1731422696; x= 1731509096; bh=f7Ois/T7L8ATxPKTsjcBzS7NAW0TZ02ZTxAqXda1k90=; b=H 3bZTdaUYRQnQw16tekNLTh8n2RPP+IJJ1HTeb7DYpzJxUBbBAz0Ip+O1YfkxOKei /tkRxcYtfjkYnY0uCXVCxm53bjhGfL1WW3dGQDTWkgsz3xqhXmt/zU7vABVWKAxi t4tsEyLHWn1O7takbYYTpmHalJwVlL3f8udP8C01jOqBT1mDVRMGSaA7MyuhJpd2 +lHJnoYtrYj8+4aPG061FWtvoSD0Aor6Pq1CIS8k3LNrs0Gy7YajkfsCFT+sxjqY jTTMHMBl0KePgA8SIxJkCTlNonGg8sBHQyNhH70stnW56GdxOwVrC3pdhzLacfb1 +FyNVdbimU9Cxg23Nnfrg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpegtggfuhfgjffevgffkfhfvofesthhqmhdthhdtjeen ucfhrhhomhepfdffrghvihguucfgrdcuhghhvggvlhgvrhdfuceouggrvhhiugesjhhush htrghthhgvohhrhidrtghomheqnecuggftrfgrthhtvghrnhepfefhvdettdfgieeufffg feehfeegffdtgeefgeetjedugfeigeevieetleduhfelnecuffhomhgrihhnpehgihhthh husgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegurghvihgusehjuhhsthgrthhhvghorhihrdgtohhmpdhnsggprhgtphhtthhope eipdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehpvghtvghrsegvihhsvghnthhr rghuthdrohhrghdprhgtphhtthhopegtrhgrihhgrdhrihhnghgvrhesvghnthgvrhhprh hishgvuggsrdgtohhmpdhrtghpthhtohepghgrsghrihgvlhgvrdgsrghrthholhhinhhi segvnhhtvghrphhrihhsvggusgdrtghomhdprhgtphhtthhopehrohgsvghrthhmhhgrrg hssehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghlvhhhvghrrhgvsegrlhhvhhdrnhho qdhiphdrohhrghdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrh gvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i7c334307:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Nov 2024 09:44:55 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.200.121\)) Subject: Re: RFC: Additional Directory for Extensions From: "David E. Wheeler" In-Reply-To: <04235387-120e-4bf6-b5c8-645d869222b9@eisentraut.org> Date: Tue, 12 Nov 2024 09:44:52 -0500 Cc: Craig Ringer , Gabriele Bartolini , Robert Haas , Alvaro Herrera , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: References: <202406251012.brdp2dobkf7n@alvherre.pgsql> <0d384836-7e6e-4932-af3b-8dad1f6fee43@eisentraut.org> <0D89C6B2-F294-4389-9DDA-07C381995292@justatheory.com> <04235387-120e-4bf6-b5c8-645d869222b9@eisentraut.org> To: Peter Eisentraut X-Mailer: Apple Mail (2.3826.200.121) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Nov 12, 2024, at 08:25, Peter Eisentraut = wrote: > 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. Ah, I see, then you just have to set both GUCs to subdirectories of the = one volume. >> Since that=E2=80=99s set at build/install time, couldn=E2=80=99t the = definition of `$libdir` here be changed to mean =E2=80=9Cthe directory = into which it=E2=80=99s being installed right now?=E2=80=9D. Doesn=E2=80=99= t seem necessary to search a path if the specific location is set at = install time. >=20 > 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. I see, so that they could be moved and, as long as dynamic_library_path = is updated, would still be findable. So back to your original caveat: >>> - The biggest problem is that many extensions set in their control = file >>>=20 >>> module_pathname =3D '$libdir/foo' >>>=20 >>> 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. Yeah, '$libdir/foo' has been the documented way to do it for quite some = time, as I recall. Perhaps the behavior of the MODULE_PATHNAME = replacement function could be changed to omit $libdir when writing the = SQL files? >> 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=E2=80=99m working = up based on them both[1], especially since there are a few other use = cases that inform it. >=20 > I'm aware of that thread, but I think that is looking like a much = larger project than what I'm proposing here. Fair enough. Once we get to some consensus on a design there (and I=E2=80=99= ve continued to iterate on it elsewhere[1]), I doubt it=E2=80=99d take = much to use this patch as the first step toward it. Best, David [1]: https://github.com/theory/justatheory/pull/7/files