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 1sjhV2-0037iU-Qd for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 15:55:53 +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 1sjhUz-00457P-Th for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 15:55:50 +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 1sjhUz-00454a-0J for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 15:55:49 +0000 Received: from pb-smtp2.pobox.com ([64.147.108.71]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjhUs-0022IX-Cg for pgsql-hackers@postgresql.org; Thu, 29 Aug 2024 15:55:47 +0000 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id C332E32132; Thu, 29 Aug 2024 11:55:39 -0400 (EDT) (envelope-from david@justatheory.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= dXrIyWlHTINwSKgJVZFZfmY7ONAMlVCoKc46xy6TKng=; b=PWx6bh/KSyMVkqgB 5NayUg67adkVFY1qEkNZqPIfe+kNoTU9zLApCHib/duTh3FVxY1R4cglOwLVUr5Q lxknZSNFe/PcjBIviyLi/oXaOMBVsYaceyW72KOG+/Ann2SkPh5FGRw5nsO1s9YT uonVArFv9VaYE6ddPx8Of2uFnbU= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id BA67232131; Thu, 29 Aug 2024 11:55:39 -0400 (EDT) (envelope-from david@justatheory.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=justatheory.com; h=content-type:mime-version:subject:from:in-reply-to:date:cc:content-transfer-encoding:message-id:references:to; s=2016-12.pbsmtp; bh=dXrIyWlHTINwSKgJVZFZfmY7ONAMlVCoKc46xy6TKng=; b=oij0ukLuNdiU3QxUzpdsRfO9oFhFSbgR2js+P05rkJ8x2/MRNvN+6/Ik6D6P0pfpOXpOqTy21eT0IeHb4Ge8q0C69E2pP0Jn/KMOyh+I67/OufLzQQV5itvSJbdwVytUOZhccWxQiHyI7vjuxQGFEakJSXK5hFnji7UQvqtNbeg= Received: from smtpclient.apple (unknown [158.222.197.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 1B06E32130; Thu, 29 Aug 2024 11:55:39 -0400 (EDT) (envelope-from david@justatheory.com) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: RFC: Additional Directory for Extensions From: "David E. Wheeler" In-Reply-To: Date: Thu, 29 Aug 2024 11:55:27 -0400 Cc: Gabriele Bartolini , Robert Haas , Alvaro Herrera , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: References: <202406251012.brdp2dobkf7n@alvherre.pgsql> To: Craig Ringer X-Mailer: Apple Mail (2.3776.700.51) X-Pobox-Relay-ID: 233475DA-661F-11EF-97BD-9B0F950A682E-76319746!pb-smtp2.pobox.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Aug 27, 2024, at 22:24, Craig Ringer = wrote: > `pg_config` only cares about compile-time settings, so I would not > expect its output to change. Right, of course that=E2=80=99s its original purpose, but extensions = depend on it to determine where to install extensions. Not just PGXS, = but also pgrx and various Makefile customizations I=E2=80=99ve seen in = the wild. > I suspect we'd have to add PGXS extension-path awareness if going for > per-extension subdir support. I'm not sure it makes sense to teach > `pg_config` about this, since it'd need to have a different mode like >=20 > pg_config --extension myextname --extension-sharedir >=20 > since the extension's "sharedir" is > $basedir/extensions/myextension/share or whatever. Right. PGXS would just need to know where to put the directory for an = extension. There should be a default for the project, and then it can be = overridden with something like DESTDIR (but without full paths under = that prefix). > Supporting this looks to be a bit intrusive in the makefiles, > requiring them to differentiate between "share dir for extensions" and > "share dir for !extensions", etc. I'm not immediately sure if it can > be done in a way that transparently converts unmodified extension PGXS > makefiles to target the new paths; it might require an additional > define, or use of new variables and an ifdef block to add > backwards-compat to the extension makefile for building on older > postgres. Yeah, might just have to be an entirely new thing, though it sure would = be nice for existing PGXS-using Makefiles to do the right thing. Maybe = for the new version of the server with the proposed new pattern it would = dispatch to the new thing somehow without modifying all the rest of its = logic. > Right. The proposed structure is rather a bigger change than I was > thinking when I suggested supporting an extension search path not just > a single extra path. But it's also a cleaner proposal; the > per-extension directory would make it easier to ensure that the > extension control file, sql scripts, and dynamic library all match the > same extension and version if multiple ones are on the path. Which is > desirable when doing things like testing a new version of an in-core > extension. =F0=9F=92=AF > Right. And I've been on the receiving end of having a small, focused > patch derailed by others jumping in and scope-exploding it into > something completely different to solve a much wider but related > problem. I=E2=80=99m not complaining, I would definitely prefer to see consensus = on a cleaner proposal along the lines we=E2=80=99ve discussed and a = commitment to time from parties able to get it done in time for v18. = I=E2=80=99m willing to help where I can with my baby C! Failing that, we = can fall back on the destdir patch. > I'm definitely not trying to stand in the way of progress with this; I > just want to make sure that it doesn't paint us into a corner that > prevents a more general solution from being adopted later. That's why > I'm suggesting making the config a multi-value string (list of paths) > and raising a runtime "ERROR: searching multiple paths for extensions > not yet supported" or something if >1 path configured. >=20 > If that doesn't work, no problem. I think the logic would have to be different, so they=E2=80=99d be = different GUCs with their own semantics. But if the core team and = committers are on board with the general idea of search paths and = per-extension directory organization, it would be best to avoid getting = stuck with maintaining the current patch=E2=80=99s GUC. OTOH, we could get it committed now and revert it later if we get the = better thing done and committed. >> I think we should get some clarity on the proposal, and then = consensus, as you say. I say =E2=80=9Cget some clarity=E2=80=9D because = my proposal doesn=E2=80=99t require recursing, and I=E2=80=99m not sure = why it=E2=80=99d be needed. >=20 > =46rom what you and Gabriele are discussing (which I agree with), it = wouldn=E2=80=99t. Ah, great. I=E2=80=99ll try to put some thought into a more formal proposal in a = new thread next week. Unless your Gabriele beats me to it =F0=9F=98=82. Best, David