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 1t6b3D-00E6MA-Oz for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Oct 2024 19:41:48 +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 1t6b3B-005OE2-Jo for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Oct 2024 19:41:45 +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 1t6b3A-005ODu-2O for pgsql-hackers@lists.postgresql.org; Thu, 31 Oct 2024 19:41:45 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6b36-003q5A-UN for pgsql-hackers@postgresql.org; Thu, 31 Oct 2024 19:41:42 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 714DB138019D; Thu, 31 Oct 2024 15:41:39 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-08.internal (MEProxy); Thu, 31 Oct 2024 15:41:39 -0400 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=1730403699; x=1730490099; bh=l/nMTdzgN61DuWs8+ wmTgZ4gq+Dn5jtboLJNvyQpvEs=; b=l2fe6p5xU+Vm6wBgZ5yD0+1UaG+IODHLo tIErh23JeLgQ4Pr562oYl2MulZasmt8FyFcjII/A1ZS/VyY/9AGyTCuaEsKyzam8 Hc3Z804j4mynNcpfZgXKjqebY2ZDTH/pdhYVUNGGDsDDg4/UucU9utzNh4j0KAYI LkVK7FEMFw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.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=fm2; t=1730403699; x=1730490099; bh=l/nMTdzgN61DuWs8+wmTgZ4gq+Dn5jtboLJNvyQpvEs=; b= i5mq2utpfcaYmds/raOnfqTVLUb0scuM9lDyiKiWQCO01Aue9sFODwnZc5Tdmi/T 15o1C3XlI9v2WOP/6QJysDQaqT9xbeCedfMh/UVoSeWZFQk9VnovHIPJMVGs2xp0 88mgPNJp8LiwKjeyk6/kSsCzYbb2sQhTpX33XsRGwrTGIYkotUWEQnGVNmK4ThC6 GCivqlMiEx52J45UGALiW9acJGQW1tHuyZpmSg9JE3uY391Opsi/fubmI3onSFzH Hp1BJR9GjFhypwhwkwE1YjnBy26jnr+lnXKTmDrFqdhsZyrwiSH/2mAOc4DsWhgQ uSxjdja/N+YPFkFWIq+I4Q== 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=1730403699; x= 1730490099; bh=l/nMTdzgN61DuWs8+wmTgZ4gq+Dn5jtboLJNvyQpvEs=; b=A q2nBmFfLuPFTLVVrYA4sEUN1wkZi7K/KOe2H0MRgvQJ/FhB3d8zucoI/fqpzig7u CHcug7V/X5u1llwd/YvKNC9Ti1JTGxfaxLVi7lJuHb1T5kbU5jQy+X489oILVerP Kj4Yy9UwD1bf10aPWx1pCx/9e3gW2fprXAL1Vetxmd6F94BWYHHosLG2+Q4Eq8Gi 9PZSvtOBICZ4k6S+QCmS2mc+Jsl0pe764GJtFacPUcErgjlVSmY+wALZE29gbEBH MIhgaLiIEUtMFV2EM8iA4x9/ey4NHS1s9ACk44dQvDW5eLDq2HpgNWQ6dgYKmpKi aBPuT245J8nNrVwEMdWUw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhhtdej necuhfhrohhmpedfffgrvhhiugcugfdrucghhhgvvghlvghrfdcuoegurghvihgusehjuh hsthgrthhhvghorhihrdgtohhmqeenucggtffrrghtthgvrhhnpeetveeigfdtueetudff jeetfeetudetjeeiudefgfetgeejkeelkeehudfguddvkeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurghvihgusehjuhhsthgrthhhvgho rhihrdgtohhmpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgt phhtthhopehgrggsrhhivghlvgdrsggrrhhtohhlihhnihesvghnthgvrhhprhhishgvug gsrdgtohhmpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhr tghpthhtohepmhihohhnseguvggsihgrnhdrohhrghdprhgtphhtthhopegrnhgurhgvsh esrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: i7c334307:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Oct 2024 15:41:38 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.200.121\)) Subject: Re: RFC: Extension Packaging & Lookup From: "David E. Wheeler" In-Reply-To: <0D3FE0EA-0E87-42BD-AB15-D3549BFD0F4C@justatheory.com> Date: Thu, 31 Oct 2024 15:41:27 -0400 Cc: Gabriele Bartolini , Peter Eisentraut , Christoph Berg , Andres Freund Content-Transfer-Encoding: quoted-printable Message-Id: <0ADD494C-83D3-42DA-B2F6-E6E435181B3D@justatheory.com> References: <2CAD6FA7-DC25-48FC-80F2-8F203DECAE6A@justatheory.com> <0D3FE0EA-0E87-42BD-AB15-D3549BFD0F4C@justatheory.com> To: PostgreSQL Hackers X-Mailer: Apple Mail (2.3826.200.121) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fellow Humans, I=E2=80=99m working on an updated proposal with more detail, and more = comprehensive. But I keep getting a bit caught up on this bit: On Oct 28, 2024, at 18:19, David E. Wheeler = wrote: >> * Binary-only extensions might also be installed here; the = difference is they have no control file. The LOAD command and = shared_preload_libraries would need to know to look here, too. >=20 > Or perhaps we should require a control file for these, too, but add a = =E2=80=9Ctype=E2=80=9D key or some such? Maybe such a shared module = could be supported by CREATE EXTENSION, as well as, but not include SQL = files? I=E2=80=99m trying to imagine how this ought to work. The challenge is = that, with the layout I propose here, shared module files will no longer = always be in `$dynamic_library_path`, but in any `$extension/pkglib` = subdirectory of each subdirectory of `extension_path`, as well. Is that = desirable? Let=E2=80=99s say we want to load a module named =E2=80=9Csemver=E2=80=9D = that=E2=80=99s included in the semver extension. With the proposed = organization up-thread, the module would be installed in: ``` $extdir_user/semver/pkglib/semver.(so|dylib|dll|etc) ``` What should be passed to preload/LOAD to load it? A few options: Option 1 -------- * Specify the module name =E2=80=9Csemver=E2=80=9D in the `LOAD` command = or in `*_preload_libraries` (same as in 17 and earlier) * Teach the preload/LOAD code to search for the module file in = `*/pkglib/` under each extension path Pros: * Follows the existing module name specification in preload/LOAD Cons: * Potentially huge number of directories to search, when lots of = extension are installed. * Depending on search order, the wrong module may be loaded if two extensions have a module file with the same name Option 2 -------- * Specify the module name to include the extension name. Perhaps = something like `$extension:$module`. * Teach the preload/LOAD code to detect the extension name as part of = the command and only look for the DSO in that extension's `pkglibdir`. Pros: * Searches at most the list of directories in the `extension_path`. * No conflicts with any other module files from other extensions. Cons: * Overloads the meaning of preload/LOAD strings, which might be = confusing to some. * Upgrades might need these values to change from the old to the new = syntax. Other Options? -------------- I kind of like Option 2, as it would allow us to eventually support = non-`CREATE EXTENSION` modules as extensions, too. I imagine = distributing, say `auto_explain` in an extension directory of its own, = with a `auto_explain.control` file that identifies it as a LOAD-only = extension. Then specifying `auto_explain:auto_explain` would work as = expected. Or perhaps just `auto_explain:` could load *all* the modules = included in the auto_explain "extension". But then maybe I'm starting to talk myself into arguing that `LOAD` = ought to be deprecated, `CREATE EXTENSION` could support non-SQL = extensions, and the `*preload*` GUCs would contain a list of extensions = rather than module files. But I digress. Any ideas about other options to address this design = challenge? Thanks, David