Re: extension_control_path

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Stephen Frost <sfrost(at)snowman(dot)net>, Sergey Muraviov <sergey(dot)k(dot)muraviov(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extension_control_path
Date: 2014-03-10 19:09:41
Message-ID: CA+TgmoYxr-kqCYkf+LgXejiL7j8qsKcaWLCTGJf59NHxn5WsgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 7, 2014 at 10:19 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>> What the $directory proposal achieves is allowing a fully relocatable
>> extension layout, where you just have to drop a directory anywhere in
>> the file system and it just works (*).
>
> If that's what you want (and it sounds attractive), why couldn't we just
> locate libraries using extension_control_path as well (which presumably
> contains the control file we are just processing). No need for another
> indirection. Libraries and control files being in separate directory
> hierarchies is a historical artifact, but it's not something that can't
> be changed if it's not what we want.
>
> The problem I have with this $directory proposal, if I understand it
> correctly, is that it requires editing of the control file at
> installation time. I don't like this for three reasons: it's not clear
> how this should actually be done, creating more broken extension build
> scripts (a big problem already); control files are part of the "code",
> so to speak, not a configuration file, and so munging it in a
> site-specific way creates a hybrid type of file that will be difficult
> to properly manage; it doesn't allow running an extension before
> installation (unless I overwrite the control file in my own source
> tree), which is my main use case for this.

+1.

>> What happens if you have more than one 'prefix.so' file in your path?
>
> The same thing that happens if you have more than one prefix.control in
> your path. You take the first one you find.
>
> Yes, if those are actually two different path settings, you need to keep
> those aligned. But that would be a one-time setting by the database
> administrator, not a per-extension-and-packager setting, so it's
> manageable. If it still bothers you, put them both in the same path, as
> I suggested above.

It's tempting to think that when you install an extension, we should
search the directory where the control file was found for the .so
first - and if so, use THAT library every time, not any other one. Of
course the problem with that is that we'd then need to remember that
in the system catalogs, which might pose a problem in terms of letting
people reorganize the filesystem hierarchy without getting too
bothered about what PostgreSQL is remembering internally.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-03-10 19:11:24 Re: pg_upgrade on high number tables database issues
Previous Message Robert Haas 2014-03-10 18:59:40 Re: Patch: show relation and tuple infos of a lock to acquire