Re: RFC: Additional Directory for Extensions - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: RFC: Additional Directory for Extensions
Date
Msg-id D7A47C4F-CA4F-4CB8-80C3-9C8C8868CCA1@justatheory.com
Whole thread Raw
In response to Re: RFC: Additional Directory for Extensions  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: RFC: Additional Directory for Extensions
List pgsql-hackers
On Jun 24, 2024, at 4:28 PM, Robert Haas <robertmhaas@gmail.com> wrote:

> As long as the GUC is superuser-only, I'm not sure what else there is
> to do here. The only question is whether there's some reason to
> disallow this even from the superuser, but I'm not quite seeing such a
> reason.

I can switch it back from requiring a restart to allowing a superuser to set it.

>> I sketched them quickly, so agree they can be better. Reading the code, I now see that it appears to be the former
case.I’d like to advocate for the latter. 
>
> Sounds good.

Yeah, though then I have a harder time deciding how it should work. pg_config’s paths are absolute. With your first
example,we just use them exactly as they are, but prefix them with the destination directory. So if it’s set to
`/my/temp/root/`,then files go into 

/my/temp/root/$(pg_conifg --sharedir)
/my/temp/root/$(pg_conifg --pkglibdir)
/my/temp/root/$(pg_conifg --bindir)
# etc.

Which is exactly how RPM and Apt packages are built, but seems like an odd configuration for general use.

>> BINDIR
>> DOCDIR
>> HTMLDIR
>> PKGINCLUDEDIR
>> LOCALEDIR
>> MANDIR
>>
>> I can imagine an extension wanting or needing to use any and all of these.
>
> Are these really all relevant to backend code?

Oh I think so. Especially BINDIR; lots of extensions ship with binary applications. And most ship with docs, too (PGXS
putsitems listed in DOCS into DOCDIR). Some might also produce man pages (for their binaries), HTML docs, and other
stuff.Maybe an FTE extension would include locale files? 

I find it pretty easy to imagine use cases for all of them. So much so that I wrote an extension binary distribution
RFC[1]and its POC[2] around them. 

Best,

David

[1]: https://github.com/orgs/pgxn/discussions/2
[1]: https://justatheory.com/2024/06/trunk-poc/




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin
Next
From: Peter Geoghegan
Date:
Subject: Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin