Re: Only one version can be installed when using extension_control_path

From: "Matheus Alcantara" <matheusssilv97(at)gmail(dot)com>
To: "Pierrick" <pierrick(dot)chovelon(at)dalibo(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "Peter Eisentraut" <peter(at)eisentraut(dot)org>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Only one version can be installed when using extension_control_path
Date: 2025-09-09 14:18:09
Message-ID: DCOC1UWBZB7C.3LO8HSGIA94LL@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue Sep 9, 2025 at 4:53 AM -03, Pierrick wrote:
>
> On 08/09/2025 17:35, Tom Lane wrote:
>> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
>>> On Monday, September 8, 2025, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
>>> wrote:
>>>> On this step it will search the .control
>>>> file on paths at extension_control_path in order and it will use the
>>>> first one that it finds and based on the .control file found it will
>>>> install the extension using the version specified on the command.
>>> Then pg_available_extensions seems broken - it lists extensions as
>>> available that are not accessible to the user due to this policy. Maybe we
>>> need to add something indicating that certain rows are hidden behind the
>>> present path setting which would need to be changed if one wishes to
>>> install them. Also seems like the extension location should be part of the
>>> output too.
>
> I agree. If an extension is the list, I expect to be able to install it.
>
I definitely agree that pg_available_extensions is wrong but I think
that a fix for this should be to don't allow extensions with the same
name on different paths.

The current behavior is to stop the searching when the first extension
name matches with the CREATE EXTENSION input, this works in the same way
when for example we have the same command on multiple paths on PATH.
Changing the behavior to search on all paths to find the extension that
matches the name and possibly the version seems complicated and
confusing to me TBH.

To have multiple versions of the same extension, the .sql files for all
versions should be put on the same path all together as already is
today. Enabling adding the same extension on multiple paths doesn't seem
right to me IMHO.

Any thoughts? I'm missing something here?

> Adding extension location is a good idea.
>
This looks like a good idea to me too.

Thanks for all the comments!

--
Matheus Alcantara

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-09-09 14:20:14 Re: Eager aggregation, take 3
Previous Message Robert Haas 2025-09-09 14:00:04 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)