Only one version can be installed when using extension_control_path

Pierrick <pierrick.chovelon@dalibo.com>

From: Pierrick <pierrick.chovelon@dalibo.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-09-05T14:22:14Z
Lists: pgsql-hackers
If the same extension is in two different paths mentioned in 
extension_control_path,
it is impossible to install the version of the last one.

postgres=# show extension_control_path ;
                            extension_control_path
-----------------------------------------------------------------------------
  $system:/extensions/meilleureextension/share:/extensions/monextension/share
(1 row)

postgres=# select * from pg_available_extensions where name like '%mon%';
      name     | default_version | installed_version |    comment
--------------+-----------------+-------------------+---------------
  monextension | 2.0             |                   | Meilleure
  monextension | 1.0             |                   | Mon extension

(2 rows)

postgres=# create extension monextension version "1.0" ;
ERROR:  extension "monextension" has no installation script nor update path for version "1.0"

postgres=# create extension monextension ;
CREATE EXTENSION
postgres=# select * from pg_available_extensions where name like '%mon%';
      name     | default_version | installed_version |    comment
--------------+-----------------+-------------------+---------------
  monextension | 2.0             | 2.0               | Meilleure
  monextension | 1.0             | 2.0               | Mon extension


Don't you think that the command

create extension monextension version "1.0" ;

should be accepted by checking in all paths ?

Pierrick,


Commits

  1. Hide duplicate names from extension views