Re: Can we avoid chdir'ing in resolve_symlinks() ? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Can we avoid chdir'ing in resolve_symlinks() ?
Date
Msg-id aef98163-c680-3705-f0c6-d8096077b381@enterprisedb.com
Whole thread Raw
In response to Re: Can we avoid chdir'ing in resolve_symlinks() ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Can we avoid chdir'ing in resolve_symlinks() ?
List pgsql-hackers
On 13.09.22 01:26, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> I think the discussion here is a bit tangential to the original topic.
> 
> Indeed, because I just wanted to reimplement *how* we resolve the
> executable path to absolute, not question whether we should do it at all.

Well, if we decided not to do it, then we could just delete the code and 
not have to think about how to change it.

> I'm not familiar with how homebrew sets up the installation
> layout, but I'm suspicious that the situation Peter refers to
> has a similar problem, only with a symlink for the bin directory
> not the individual executable.

I think the two contradicting use cases are:

1) You configure and install with prefix=/usr/local/pgsql, and then 
symlink ~/bin/pg_ctl -> /usr/local/pgsql/bin/pg_ctl; hoping that that 
will allow pg_ctl to find the other programs it needs in 
/usr/local/pgsql/bin.  This is what we currently support.

2) You configure and install with prefix=/usr/local/pgsql-14, and then 
symlink /usr/local/pgsql -> /usr/local/pgsql-14; hoping that you can 
then use /usr/local/pgsql as if that's where it actually is.  We don't 
currently support that.  (Note that it would work if you made a copy of 
the tree instead of using the symlink.)

I don't know if anyone uses #1 or what the details of such use are.

#2 is how Homebrew and some other packaging systems work.




pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Tuples inserted and deleted by the same transaction
Next
From: Tom Lane
Date:
Subject: Re: Can we avoid chdir'ing in resolve_symlinks() ?