Re: extension_control_path: ignore empty elements and deduplicate directories

From: "Matheus Alcantara" <matheusssilv97(at)gmail(dot)com>
To: "Andres Freund" <andres(at)anarazel(dot)de>, "Chao Li" <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extension_control_path: ignore empty elements and deduplicate directories
Date: 2026-11-16 16:20:41
Message-ID: DMWRTKC9411K.35NSRHXCLZ606@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andres,

On Mon Nov 16, 2026 at 12:10 PM -03, Andres Freund wrote:
> Hi,
>
> On 2026-11-03 13:21:17 +0800, Chao Li wrote:
>> 1. Empty path elements are silently interpreted as "/extension"
>>
>> Say a user sets extension_control_path = '$system:', it will be interpreted as two paths: $system and an empty string, and the empty string will be expanded to "/extension". Since "/extension" is an absolute path, it will be searched for extensions. If the host machine doesn't have "/extension", the path will be silently ignored; but if the directory happens to exist, it will be searched for extensions, which doesn't sound desirable, because the user might not be aware of that at all.
>>
>> Adding a trailing colon is an easy mistake to make, but silently searching "/extension" is unintended behavior. So I think we should silently discard empty path elements. An entirely empty string ('') is interpreted as $system as documented, and that behavior should be retained.
>
> I don't like silently ignoring user mistakes. Either we should make it an
> error or accept it. Which user would be served by silently reinterpreting
> what they might have meant?
>

The idea on v6 is that it just discard empty path elements. It doesn't
mean that the path element will be reinterpreted. So if an user set
extension_control_path = '$system:' just $system will be used.

We already ignore paths that does not exists, so the idea was to follow
the same behavior.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-11-16 16:21:28 Re: Incremental Sort crash on a rescan that becomes bounded
Previous Message David Geier 2026-11-16 16:06:45 Re: Use correct collation in pg_trgm