Thread: BUG #17939: CREATE EXTENSION pltcl; looks in the wrong folder

BUG #17939: CREATE EXTENSION pltcl; looks in the wrong folder

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      17939
Logged by:          Matthew Baynham
Email address:      matthew.baynham@gmail.com
PostgreSQL version: 15.2
Operating system:   Ubuntu 2304
Description:

I install pltcl with the following command...
sudo apt-get install postgresql-pltcl

Then I need to create the extension with...
CREATE EXTENSION pltcl;

So now I have version 15.2 of PostgreSQL and the apt-get command did it's
job correctly and installed into...
matthew@matthew-QEMU:~$ cd "/usr/share/postgresql/15/extension"
matthew@matthew-QEMU:/usr/share/postgresql/15/extension$ ls plt*
pltcl--1.0.sql  pltcl.control  pltclu--1.0.sql  pltclu.control

However the create extension command is looking in the wrong folder.
matthew@matthew-QEMU:~$ psql -d matthew -U matthew
psql (15.2 (Ubuntu 15.2-1), server 14.7 (Ubuntu 14.7-0ubuntu0.22.10.1))
Type "help" for help.

matthew=# CREATE EXTENSION pltcl;
ERROR:  could not open extension control file
"/usr/share/postgresql/14/extension/pltcl.control": No such file or
directory

So when the version I have is definitely version 15.2 it looks for
extensions in the folder for version 14.


Re: BUG #17939: CREATE EXTENSION pltcl; looks in the wrong folder

From
Julien Rouhaud
Date:
On Tue, May 23, 2023 at 06:47:19AM +0000, PG Bug reporting form wrote:
>
> matthew@matthew-QEMU:~$ psql -d matthew -U matthew
> psql (15.2 (Ubuntu 15.2-1), server 14.7 (Ubuntu 14.7-0ubuntu0.22.10.1))
> [...]
> So when the version I have is definitely version 15.2 it looks for
> extensions in the folder for version 14.

The *client* version is definitely 15.2, but as psql told when you opened the
connection you're actually connected on a 14.7 *server*, so postgres is
searching in the correct folder.

You can look at e.g. pg_lsclusters to see what instances are currently setup,
and of which version.