Daniel Gustafsson <dan...@yesql.se> writes: >> On 7 Nov 2018, at 08:23, Peter Eisentraut <peter.eisentr...@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