Re: Support custom socket directory in pg_upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support custom socket directory in pg_upgrade
Date: 2018-11-12 19:00:35
Message-ID: 28968.1542049235@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>> On 7 Nov 2018, at 08:23, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>> Why not always create a temporary directory and put it there. Then we
>> don't need an option. It's not like the current directory is a
>> particularly good choice anyway.

> I agree that cwd isn’t a terribly good default, but is there a good way to
> identify a suitable temporary directory to use across all platforms (mostly
> thinking about Windows)?

Windows isn't a problem because it doesn't do Unix-style sockets anyway.
However, I agree that Peter's proposal is just begging the question of
how we'd identify a better default choice than cwd.

Also, even if we had an arguably-better idea, I suspect that there would
always be cases where it didn't work. For example, one idea is to make
a temporary directory under the installation's normal socket directory
(thus, /tmp/pgXXXX/ or some such). But, if the normal socket directory
is not /tmp, we might find that pg_upgrade can't write there.

So I'm inclined to think that a --socketdir option is a reasonable
feature independently of whether someone comes up with a different
proposal for the default location.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-11-12 19:08:23 PostgreSQL BuildFarm Client Release 9
Previous Message Jeremy Finzel 2018-11-12 18:25:07 Race condition in WaitForBackgroundWorkerStartup