On 06/04/2013 06:25 PM, Tom Lane wrote:
>> What wolud work best for us is to allow this path to be configurable,
>> ideally through either an environment variable, command line switch, or
>> (and this is the least desirable) a postgresql.conf option.
> Basically, none of those are likely to get accepted because of security
> concerns. We *don't* want this path to be run-time adjustable.
It turns out that the current way things are done is almost enough.
Here's how it works at the moment:
We have a 'postgresql' expression which builds PostgreSQL from a tarball
- configure/make/make install to some directory. Next, extensions are
built into their own (entirely separate) directories. Finally, there is
a bit of glue at the end that builds a 'postgresql-and-plugins'
directory, which is a tree consisting entirely of symlinks to the
'postgresql' directory and all the various extensions. Thus the final
tree looks as would be expected if this were on a mutable file system.
I'm currently having a bit of a problem in that Pg still seems to look
in the 'postgresql' directory, not the '-and-plugins' one. I'm not sure
what's going on here, because if I understand the source code correctly,
it should be finding a common root based on #defines at install time,
and then finding this relative to the currently executing path. Could it
be that the symlink to the postgres binary is being expanded before this
path construction takes place?