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 1u9VQ7-002aru-14 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Apr 2025 20:49:43 +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 1u9VQ4-0038Fz-EB for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Apr 2025 20:49:41 +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 1u9VQ3-0038En-Gw for pgsql-hackers@lists.postgresql.org; Mon, 28 Apr 2025 20:49:41 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u9VQ0-00040F-2V for pgsql-hackers@lists.postgresql.org; Mon, 28 Apr 2025 20:49:38 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9457211401C8; Mon, 28 Apr 2025 16:49:35 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 28 Apr 2025 16:49:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=justatheory.com; h=cc:cc: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=1745873375; x= 1745959775; bh=lFthTiR9iHPnNXj2ooTKxqEHRd03Ijm8eoBmRxl164w=; b=k jxHAVl9IqpBbsg2HaVRTTGZw4m+/tcPDIbVLrvBYv9m32i+3Sks/cXvdo6wNojVQ Cz7GaQZKFg+u7q+XwMElNfgbsntdRt4uvZw/yDkqO5OqDj5/VsAQx+YWlpm6c01i uQ+OPE0cHto+yXeb6tXy/J3F5SL1eNprYjus10u/V1FgueXtnSGPBYszpgFiU8Wf 6jw1f46P0AoquNwolRStUcHBSv5PW7Bhr9NmAPSMvkBmQCxDDLFcSkKEbdMymaec WtOUgnD1NnD6vqVxJToXtbC6Ahic4JKaf8DnsopzzDLMn6EnI4NbKLzmXYXgGHM9 guVC8q2uYjISFuC5zncWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= 1745873375; x=1745959775; bh=lFthTiR9iHPnNXj2ooTKxqEHRd03Ijm8eoB mRxl164w=; b=Y/30++A4TfNsF2ITKkhelPYJnuVcBQHO5PJiVwJkxgXTolNQpSY SLk5l1Luv9VUSplvNrjgLzKt5IUDKEI9N10sfBRKT9Iwfgi9h580mR9PA/72GZCO 8w7+zeUxmq9t/DZSjUdm8D5R7NBf1+XM35zsjR6vBmqQ6+OJWTGcCJFUwb1o6+LT 2peo+C8tu3TAgPH3Y5i2haS9qBs/aNeRZeRnMODgkg2s2jyOygXQkSFfsg2+pai+ K1DZHL8MLXYEBV2CFXZmzhpzfYdTupOPlpD+ddEQTEeq+l5B8B27sqrcNTFcnGZh FG0AzMHaGIJxVf+Ph/1meHqjf5o+tpT6cLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieduleehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurheptggguffhjgffvefkfhfvofesghdtmherhhdt jeenucfhrhhomhepfdffrghvihguucfgrdcuhghhvggvlhgvrhdfuceouggrvhhiugesjh hushhtrghthhgvohhrhidrtghomheqnecuggftrfgrthhtvghrnhephffhieeitdefkeev hfehtdfgieehgfffleetjeetkeeitdeugeejgeefffffkeeinecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggrvhhiugesjhhushhtrghthhgv ohhrhidrtghomhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepmhgrthhhvghushhsshhilhhvleejsehgmhgrihhlrdgtohhmpdhrtghpthht ohepmhihohhnseguvggsihgrnhdrohhrghdprhgtphhtthhopehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrghdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhs thhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i7c334307:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Apr 2025 16:49:34 -0400 (EDT) Content-Type: multipart/signed; boundary="Apple-Mail=_EC4B9A6B-3605-4D2D-ACC1-864D5C216261"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Subject: Re: extension_control_path and "directory" From: "David E. Wheeler" In-Reply-To: Date: Mon, 28 Apr 2025 16:49:23 -0400 Cc: Christoph Berg , Peter Eisentraut , pgsql-hackers@lists.postgresql.org Message-Id: References: <3C304C9E-976C-4FB9-A883-707E0B90756A@justatheory.com> <546E7C54-D2F4-4DBB-9A06-EBBF90265A2C@justatheory.com> <672C8C5E-519A-4B39-9421-E6C31917B271@justatheory.com> To: Matheus Alcantara X-Mailer: Apple Mail (2.3826.500.181.1.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_EC4B9A6B-3605-4D2D-ACC1-864D5C216261 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Apr 25, 2025, at 17:18, Matheus Alcantara = wrote: > Ok, I was testing using extension_control_path =3D = '$system:/my/custom/path' > (starting with the macro) and it was working as expected, testing with > the macro at the end does not work. Great example of why it=E2=80=99s useful to do as much testing as = possible! That=E2=80=99s an entirely reasonable place to start testing = :-) > The problem was on find_extension_control_filename() that was = appending > the /extension at the end of the entire extension_control_path GUC = value > instead of just the custom paths. Oh yeah, lol, that wouldn=E2=80=99t work. > To append the /extension at each path on extension_control_path would > require some changes on find_in_path() that > find_extension_control_filename() calls, which I think that it would > make the function more complicated. I've them created a similar > find_in_paths() function that works in the same way but it receives a > List of paths instead of the string of paths separated by ":". We can > get this List of paths using get_extension_control_directories() that > also handle the macro substitution like find_in_path(). >=20 > Attached v4 with these fixes. I hope that now you should be able to = omit > the /extension from the GUC value. Yes! It now works with this configuration: ```ini extension_control_path =3D = '/Users/david/Downloads/share/postgresql:$system' dynamic_library_path =3D = '/Users/david/Downloads/lib/postgresql:$libdir=E2=80=99 ``` Which is nicely more consistent. Kind of want that first one to be = called =E2=80=9Cshare_path=E2=80=9D now, though, since it=E2=80=99s not = just extensions. Although I guess it=E2=80=99s only extension control = file searching that uses it (for now). If I understand this bit correctly: ```c /* Substitute the path macro if needed */ mangled =3D substitute_path_macro(piece, "$system", system_dir); /* * Append "extension" suffix in case is a custom extension control * path. */ if (strcmp(piece, "$system") !=3D 0) mangled =3D psprintf("%s/extension", mangled); ``` The value of `piece` is a single path from the search path, right? If = so, I think it=E2=80=99s either `$system` or something else; I don=E2=80=99= t it would ever be that `$system` is a substring of a single path. Is = that right? Other than that, I think this patch is good to go. Thanks! Best, David `= --Apple-Mail=_EC4B9A6B-3605-4D2D-ACC1-864D5C216261 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd+KfmbOQis6ZycGGkt9idPjIgfEFAmgP6dMACgkQkt9idPjI gfHaBw/9EIUm9k+nX6Is2KWGo45KS4dbmGBpzlxKX6Ocz26meFLhziSaMa9l3wjX 5rYcb19zbSfhJ7GQKyMmYtId3VK4+DnxnUrbbtKFz7l85khL+XGJDiy1qqEGcgy0 m5bQdHKiO7JHOTsVL1LaX4ZTZ03IV2fUDuCxk0ShaFP3ie0artGTOsCS+hwU6Grn R9Q5jUHgs8BJJLJvr4C/u6RScQv8k4jFqEJlxWlasu1/6yzaebdRA6ZiujeQXcIj Z6ui9DKEi/HE4BnRZL4SrRLJI3vyZX1pIoKaDPM+r2/326PluuaM00KqWBnlsyeA 8aTqD/YJtG6aRSDZeD3nOqxZX+w2qj3bKvUh+0/8wb3QMFBzAisVCOZKkX7ipn0D QHKDo99sqguvmzgtyOAmMvqLcgToisAsJCm5oSfJgkQHxbH3haE0WSlALU7rRX7E VnSRRAiGbPNdfx4SSxSwmJOayx337gNhw41gWEKkdbBYlQ9lpQCbwJuH8z1XY6zZ olMVedhRtDd879yxD0AylRecI2cPNvjhdHhuG4adNEZrrKAwh2D9AMH6/lVlrKLi gmX6nsCBFlYnZGzWT34kEiw5aJsu26h5lYvu+WJlb9ytY7hnRz7DAYQUniUhRgqZ eZMI0SB43bvffIRs5XFEJqUxr8MJbcSemJfD69b3C90OMDB7pdo= =PdPH -----END PGP SIGNATURE----- --Apple-Mail=_EC4B9A6B-3605-4D2D-ACC1-864D5C216261--