Re: Support custom socket directory in pg_upgrade - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Support custom socket directory in pg_upgrade
Date
Msg-id 28968.1542049235@sss.pgh.pa.us
Whole thread Raw
In response to Re: Support custom socket directory in pg_upgrade  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Support custom socket directory in pg_upgrade
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 7 Nov 2018, at 08:23, Peter Eisentraut <peter.eisentraut@2ndquadrant.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


pgsql-hackers by date:

Previous
From: Jeremy Finzel
Date:
Subject: Race condition in WaitForBackgroundWorkerStartup
Next
From: Elvis Pranskevichus
Date:
Subject: Re: [HACKERS] [PATCH v2] Add and report the new "session_read_only" GUC pseudo-variable.