@@ -96,7 +96,6 @@ static const char *progname;
96
96
static char * logfilename ;
97
97
static FILE * logfile ;
98
98
static char * difffilename ;
99
- static char * sockdir ;
100
99
101
100
static _resultmap * resultmap = NULL ;
102
101
@@ -754,7 +753,8 @@ initialize_environment(void)
754
753
* the wrong postmaster, or otherwise behave in nondefault ways. (Note
755
754
* we also use psql's -X switch consistently, so that ~/.psqlrc files
756
755
* won't mess things up.) Also, set PGPORT to the temp port, and set
757
- * PGHOST depending on whether we are using TCP or Unix sockets.
756
+ * or unset PGHOST depending on whether we are using TCP or Unix
757
+ * sockets.
758
758
*/
759
759
unsetenv ("PGDATABASE" );
760
760
unsetenv ("PGUSER" );
@@ -766,24 +766,7 @@ initialize_environment(void)
766
766
if (hostname != NULL )
767
767
doputenv ("PGHOST" , hostname );
768
768
else
769
- {
770
- sockdir = getenv ("PG_REGRESS_SOCK_DIR" );
771
- if (!sockdir )
772
- {
773
- /*
774
- * Since initdb creates the data directory with secure
775
- * permissions, we place the socket there. This ensures no
776
- * other OS user can open our socket to exploit our use of
777
- * trust authentication. Compared to using the compiled-in
778
- * DEFAULT_PGSOCKET_DIR, this also permits testing to work in
779
- * builds that relocate it to a directory not writable to the
780
- * build/test user.
781
- */
782
- sockdir = malloc (strlen (temp_install ) + sizeof ("/data" ));
783
- sprintf (sockdir , "%s/data" , temp_install );
784
- }
785
- doputenv ("PGHOST" , sockdir );
786
- }
769
+ unsetenv ("PGHOST" );
787
770
unsetenv ("PGHOSTADDR" );
788
771
if (port != -1 )
789
772
{
@@ -2202,11 +2185,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
2202
2185
*/
2203
2186
header (_ ("starting postmaster" ));
2204
2187
snprintf (buf , sizeof (buf ),
2205
- SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s "
2206
- "-c \"listen_addresses=%s\" -k \"%s\" "
2207
- "> \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2208
- bindir , temp_install , debug ? " -d 5" : "" ,
2209
- hostname ? hostname : "" , sockdir ? sockdir : "" ,
2188
+ SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2189
+ bindir , temp_install ,
2190
+ debug ? " -d 5" : "" ,
2191
+ hostname ? hostname : "" ,
2210
2192
outputdir );
2211
2193
postmaster_pid = spawn_process (buf );
2212
2194
if (postmaster_pid == INVALID_PID )
0 commit comments