Yet another issue with pg_upgrade vs unix_socket_directories

Started by Tom Laneover 13 years ago4 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

I went back for another try at building the Fedora packages with 9.2
branch tip ... and it still failed at pg_upgrade's "make check".
The reason for this is that test.sh starts a couple of random
postmasters, and those postmasters expect to put their sockets in
the configured default location (which is now /var/run/postgresql
on Fedora), and that's not there in a minimal build environment.

I hacked it up with the attached quick-and-dirty patch, but I wonder
if anyone's got a better idea.

regards, tom lane

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#1)
Re: Yet another issue with pg_upgrade vs unix_socket_directories

On 9/3/12 5:00 PM, Tom Lane wrote:

I went back for another try at building the Fedora packages with 9.2
branch tip ... and it still failed at pg_upgrade's "make check".
The reason for this is that test.sh starts a couple of random
postmasters, and those postmasters expect to put their sockets in
the configured default location (which is now /var/run/postgresql
on Fedora), and that's not there in a minimal build environment.

And if it's there, it might not be writable.

I hacked it up with the attached quick-and-dirty patch, but I wonder
if anyone's got a better idea.

Yeah, I have resorted to putting something like

export PGHOST=/tmp

in all my test scripts, because the above-mentioned issues have affected
Debian for a long time. Welcome to the party. ;-)

It might actually be useful if the postmaster accepted PGHOST as the
default value for the -k option, just like it accepts PGPORT. Then this
type setup will become much easier because clients and servers will use
the same defaults.

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: Yet another issue with pg_upgrade vs unix_socket_directories

On Tue, Sep 4, 2012 at 01:44:59PM -0400, Peter Eisentraut wrote:

On 9/3/12 5:00 PM, Tom Lane wrote:

I went back for another try at building the Fedora packages with 9.2
branch tip ... and it still failed at pg_upgrade's "make check".
The reason for this is that test.sh starts a couple of random
postmasters, and those postmasters expect to put their sockets in
the configured default location (which is now /var/run/postgresql
on Fedora), and that's not there in a minimal build environment.

And if it's there, it might not be writable.

I hacked it up with the attached quick-and-dirty patch, but I wonder
if anyone's got a better idea.

Yeah, I have resorted to putting something like

export PGHOST=/tmp

in all my test scripts, because the above-mentioned issues have affected
Debian for a long time. Welcome to the party. ;-)

It might actually be useful if the postmaster accepted PGHOST as the
default value for the -k option, just like it accepts PGPORT. Then this
type setup will become much easier because clients and servers will use
the same defaults.

Interesting idea, but PGPORT controls both the tcp and unix domain
socket connections. Wouldn't PGHOST just control just unix domain? Is
that logical?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#2)
Re: Yet another issue with pg_upgrade vs unix_socket_directories

Peter Eisentraut <peter_e@gmx.net> writes:

Yeah, I have resorted to putting something like
export PGHOST=/tmp
in all my test scripts, because the above-mentioned issues have affected
Debian for a long time. Welcome to the party. ;-)

Yeah, my current patch for Fedora does exactly that in pg_regress, and
has it force the test postmaster's unix_socket_directory as well.
The problem with pg_upgrade's shell script is that it's not going
through pg_regress: it launches some test postmasters directly, and
also fires up psql etc directly. So it needs its own fix for this.

It might actually be useful if the postmaster accepted PGHOST as the
default value for the -k option, just like it accepts PGPORT. Then this
type setup will become much easier because clients and servers will use
the same defaults.

Cute idea, but it'll fall down rather badly if PGHOST is a hostname...

There's no time to redesign this stuff for 9.2, but now that I've had
some exposure to the testing difficulties created by a nonstandard
default socket directory, I'm more interested in trying to fix these
issues in core.

regards, tom lane