Re: extension_control_path and "directory"

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: extension_control_path and "directory"
Date: 2025-04-23 13:57:46
Message-ID: 3C304C9E-976C-4FB9-A883-707E0B90756A@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Apr 23, 2025, at 09:50, Christoph Berg <myon(at)debian(dot)org> wrote:

> Remembering which path the .control file was found in and from there
> open the extension "directory" doesn't sound too hard. Why does it
> have to be more complicated?

This was my question, as well. Do you have a WIP patch to share, Matheus?

> Also, re-running a search path discovery for the directory is probably
> just wrong, if there are different extension versions in the "control"
> search path and the "extensions" search path, it might lead to weird
> version skew problems.

I assumed we would just have one or the other GUCs, not both.

> The number of extensions using that feature is limited, though, so it
> wouldn't be a huge problem:

FWIW it’s a a simple patch to make semver work, and probably also for the others. It’s just the reverse of this change[1]:

```patch
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,6 @@ EXTVERSION = $(shell grep -m 1 '[[:space:]]\{8\}"version":' META.json | \
DISTVERSION = $(shell grep -m 1 '[[:space:]]\{3\}"version":' META.json | \
sed -e 's/[[:space:]]*"version":[[:space:]]*"\([^"]*\)",\{0,1\}/\1/')
-MODULEDIR = semver
DATA = $(wildcard sql/*.sql)
DOCS = $(wildcard doc/*.mmd)
TESTS = $(wildcard test/sql/*.sql)
--- a/semver.control
+++ b/semver.control
@@ -1,7 +1,5 @@
# semver extension
comment = 'Semantic version data type'
default_version = '0.32.1'
-
-directory = 'semver'
module_pathname = '$libdir/semver'
relocatable = true

```

I think I’ll write a blog post this week recommending people not use these directives, and also to remove `$lib/` from `module_pathname`.

Best,

David

[1]: https://github.com/theory/pg-semver/commit/88b3abd

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Christoph Berg 2025-04-23 14:01:33 vacuumdb --missing-stats-only and pg_upgrade from PG13
Previous Message Christoph Berg 2025-04-23 13:50:54 Re: extension_control_path and "directory"

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2025-04-23 14:01:33 vacuumdb --missing-stats-only and pg_upgrade from PG13
Previous Message Christoph Berg 2025-04-23 13:50:54 Re: extension_control_path and "directory"