Re: RFC: Additional Directory for Extensions

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Gabriele Bartolini <gabriele(dot)bartolini(at)enterprisedb(dot)com>, Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: RFC: Additional Directory for Extensions
Date: 2025-02-05 18:13:25
Message-ID: 2D16ECD6-2D3E-4D08-A056-672B7E0329AB@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andrew,

On Feb 4, 2025, at 15:34, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

>> I see. I confirm that works. Still, don’t all the other parameters work when passed to any/all targets? Should this one have an extension-specific name?
>
> IDK, I don't understand what you think you're saying when you specify --prefix to an extension build (as opposed to an install).

I am unfamiliar with that option. Although `prefix` is mentioned in the PGXS docs[1] in the context of other variables, it is not itself documented, neither as `prefix=` as Peter suggests, nor as `--prefix`.

At any rate, all the other PGXS variables I’ve used have worked with all the make targets, though they obviously don’t necessarily change the behavior of all of the targets.

>> ISTM it does more harm than good. The location of extension files should be highly predictable. I think the search path functionality mitigates the need for this parameter, and it should be dropped.
>
> I agree that we should either drop the "directory" directive or fix this patch so it doesn't break it. I have never used the directive, not sure I was even aware of its existence, so I have no objection to dropping it.

I only just started using it, thinking it keeps things better organized. But it’s honestly a bit confusing, in that one must set both the `MODULEDIR` variable in the `Makefile` and the `directory` variable in the control file.

Best,

David

[1]: https://www.postgresql.org/docs/current/extend-pgxs.html

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2025-02-05 18:17:17 Re: Inquiry About Google Summer of Code Projects
Previous Message Tom Lane 2025-02-05 18:07:58 Re: Failed assertion with jit enabled