Re: extension_control_path and "directory"

From: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: Christoph Berg <myon(at)debian(dot)org>, 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 20:34:26
Message-ID: CAFY6G8c=W8CMFwcx2fA0RSFtvw=5BDGKOjGSV=nEUiZ6use2Bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Apr 23, 2025 at 10:57 AM David E. Wheeler <david(at)justatheory(dot)com> wrote:
>
> 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?
>
I spent some time trying to implement this and somehow I got lost in the
changes I thought I would need to make to the "find_in_path" function
and others it calls, but reading these messages and looking at the code
again I think that the change is much simpler than I thought.

Attached is a draft patch that uses the path that the .control file was
found to search for the script files when the "directory" is set on the
.control file.

I've tested with the semver extension and it seems to work fine with
this patch. Can you please check on your side to see if it's also
working?

I still want to make some polish on this patch and also include some
more test cases using the "directory" on the .control file but I think
that is stable to make some tests, make check and check-world is happy.

--
Matheus Alcantara

Attachment Content-Type Size
v1-0001-Make-directory-work-with-extension-control-path.patch application/octet-stream 4.6 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-04-24 00:21:30 pgsql: Add sanity check for dshash entries when reading pgstats file
Previous Message Tom Lane 2025-04-23 20:05:17 pgsql: Avoid possibly-theoretical OOM crash hazard in hash_create().

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-04-23 21:17:01 Non-reproducible AIO failure
Previous Message Daniel Gustafsson 2025-04-23 20:34:15 Re: [PATCH] Support older Pythons in oauth_server.py