Re: Can we avoid chdir'ing in resolve_symlinks() ?

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Can we avoid chdir'ing in resolve_symlinks() ?
Date: 2022-09-13 14:37:34
Message-ID: aef98163-c680-3705-f0c6-d8096077b381@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.09.22 01:26, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-09-13 15:16:02 Re: Can we avoid chdir'ing in resolve_symlinks() ?
Previous Message Matthias van de Meent 2022-09-13 14:13:44 Re: Tuples inserted and deleted by the same transaction