Re: Support custom socket directory in pg_upgrade

2018-12-06 Thread Noah Misch
On Sat, Nov 17, 2018 at 10:15:08PM +0100, Daniel Gustafsson wrote: > > On 15 Nov 2018, at 22:42, Tom Lane wrote: > > > Further point about that: pg_regress's method of creating a temp > > directory under /tmp is secure only on machines with the stickybit > > set on /tmp; otherwise it's possible

Re: Support custom socket directory in pg_upgrade

2018-12-01 Thread Tom Lane
Peter Eisentraut writes: > On 30/11/2018 17:58, Tom Lane wrote: >> Given that we have a patch for this approach, and no patch has been >> offered for the /tmp approach, I'm kind of inclined to exercise >> committer's discretion and proceed with this patch. Will anybody >> be seriously annoyed if

Re: Support custom socket directory in pg_upgrade

2018-11-30 Thread Peter Eisentraut
On 30/11/2018 17:58, Tom Lane wrote: > So we seem to be at an impasse here. By my count, three people have > expressed support for the patch's approach of adding a socket-directory > option, while two people seem to prefer the idea of putting pg_upgrade's > socket under /tmp (possibly with a way

Re: Support custom socket directory in pg_upgrade

2018-11-30 Thread Tom Lane
I wrote: > Alvaro Herrera writes: >> On 12/11/2018 20:00, Tom Lane wrote: >>> Also, even if we had an arguably-better idea, I suspect that there would >>> always be cases where it didn't work. >> Surely they can just set TMPDIR if /tmp is not writable? If TMPDIR is >> set and not writable, bark

Re: Support custom socket directory in pg_upgrade

2018-11-25 Thread Tom Lane
Daniel Gustafsson writes: > [ pg_upgrade_sockdir-v3.patch ] BTW, I notice that cfbot doesn't like this now that Thomas is running it with -Werror: option.c: In function ‘parseCommandLine’: option.c:265:8: error: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result

Re: Support custom socket directory in pg_upgrade

2018-11-23 Thread Tom Lane
Alvaro Herrera writes: > On 12/11/2018 20:00, Tom Lane wrote: >>> Also, even if we had an arguably-better idea, I suspect that there would >>> always be cases where it didn't work. > Surely they can just set TMPDIR if /tmp is not writable? If TMPDIR is > set and not writable, bark at the user

Re: Support custom socket directory in pg_upgrade

2018-11-23 Thread Alvaro Herrera
On 2018-Nov-12, Tom Lane wrote: > Peter Eisentraut writes: > > On 12/11/2018 20:00, Tom Lane wrote: > >> 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

Re: Support custom socket directory in pg_upgrade

2018-11-17 Thread Daniel Gustafsson
> On 15 Nov 2018, at 22:42, Tom Lane wrote: > Further point about that: pg_regress's method of creating a temp > directory under /tmp is secure only on machines with the stickybit > set on /tmp; otherwise it's possible for an attacker to rename the > temp dir out of the way and inject his own

Re: Support custom socket directory in pg_upgrade

2018-11-15 Thread Tom Lane
I wrote: > Peter Eisentraut writes: >> On 12/11/2018 20:00, Tom Lane wrote: >>> 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

Re: Support custom socket directory in pg_upgrade

2018-11-12 Thread Tom Lane
Peter Eisentraut writes: > On 12/11/2018 20:00, Tom Lane wrote: >> 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 >>

Re: Support custom socket directory in pg_upgrade

2018-11-12 Thread Peter Eisentraut
On 12/11/2018 20:00, Tom Lane wrote: > 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/pg/ or some such).

Re: Support custom socket directory in pg_upgrade

2018-11-12 Thread Tom Lane
Daniel Gustafsson writes: >> On 7 Nov 2018, at 08:23, Peter Eisentraut >> 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

Re: Support custom socket directory in pg_upgrade

2018-11-07 Thread Daniel Gustafsson
> On 6 Nov 2018, at 09:19, Thomas Munro wrote: > > On Wed, Oct 10, 2018 at 9:27 AM Daniel Gustafsson > wrote: >>> On 9 Oct 2018, at 16:22, Tom Lane wrote: >>> Daniel Gustafsson writes: Having hit the maximum socketdir length error a number of times in

Re: Support custom socket directory in pg_upgrade

2018-11-06 Thread Peter Eisentraut
On 09/10/2018 15:09, Daniel Gustafsson wrote: > Having hit the maximum socketdir length error a number of times in pg_upgrade, > especially when running tests in a deep directory hierarchy, I figured it was > time to see if anyone else has had the same problem? The attached patch is > what I run

Re: Support custom socket directory in pg_upgrade

2018-11-06 Thread Thomas Munro
On Wed, Oct 10, 2018 at 9:27 AM Daniel Gustafsson wrote: > > On 9 Oct 2018, at 16:22, Tom Lane wrote: > > Daniel Gustafsson writes: > >> Having hit the maximum socketdir length error a number of times in > >> pg_upgrade, > >> especially when running tests in a deep directory hierarchy, I

Re: Support custom socket directory in pg_upgrade

2018-10-25 Thread Hironobu SUZUKI
Hi, I reviewed `pg_upgrade_sockdir-v2.patch`. I checked `-s` option on OSX. I confirmed that all tools, which are internally invoked such as pg_dumpall and pg_restore, used the specified socket and pg_upgrade worked as expected. I think this patch is fine. Best regards, On 2018/10/09

Re: Support custom socket directory in pg_upgrade

2018-10-09 Thread Daniel Gustafsson
> On 9 Oct 2018, at 16:22, Tom Lane wrote: > > Daniel Gustafsson writes: >> Having hit the maximum socketdir length error a number of times in >> pg_upgrade, >> especially when running tests in a deep directory hierarchy, I figured it was >> time to see if anyone else has had the same problem?

Re: Support custom socket directory in pg_upgrade

2018-10-09 Thread Tom Lane
Daniel Gustafsson writes: > Having hit the maximum socketdir length error a number of times in pg_upgrade, > especially when running tests in a deep directory hierarchy, I figured it was > time to see if anyone else has had the same problem? The attached patch is > what I run with locally to

Support custom socket directory in pg_upgrade

2018-10-09 Thread Daniel Gustafsson
Having hit the maximum socketdir length error a number of times in pg_upgrade, especially when running tests in a deep directory hierarchy, I figured it was time to see if anyone else has had the same problem? The attached patch is what I run with locally to avoid the issue, it adds a