@@ -109,7 +109,6 @@ static const char *progname;
109
109
static char * logfilename ;
110
110
static FILE * logfile ;
111
111
static char * difffilename ;
112
- static char * sockdir ;
113
112
114
113
static _resultmap * resultmap = NULL ;
115
114
@@ -760,7 +759,8 @@ initialize_environment(void)
760
759
* the wrong postmaster, or otherwise behave in nondefault ways. (Note
761
760
* we also use psql's -X switch consistently, so that ~/.psqlrc files
762
761
* won't mess things up.) Also, set PGPORT to the temp port, and set
763
- * PGHOST depending on whether we are using TCP or Unix sockets.
762
+ * or unset PGHOST depending on whether we are using TCP or Unix
763
+ * sockets.
764
764
*/
765
765
unsetenv ("PGDATABASE" );
766
766
unsetenv ("PGUSER" );
@@ -772,24 +772,7 @@ initialize_environment(void)
772
772
if (hostname != NULL )
773
773
doputenv ("PGHOST" , hostname );
774
774
else
775
- {
776
- sockdir = getenv ("PG_REGRESS_SOCK_DIR" );
777
- if (!sockdir )
778
- {
779
- /*
780
- * Since initdb creates the data directory with secure
781
- * permissions, we place the socket there. This ensures no
782
- * other OS user can open our socket to exploit our use of
783
- * trust authentication. Compared to using the compiled-in
784
- * DEFAULT_PGSOCKET_DIR, this also permits testing to work in
785
- * builds that relocate it to a directory not writable to the
786
- * build/test user.
787
- */
788
- sockdir = malloc (strlen (temp_install ) + sizeof ("/data" ));
789
- sprintf (sockdir , "%s/data" , temp_install );
790
- }
791
- doputenv ("PGHOST" , sockdir );
792
- }
775
+ unsetenv ("PGHOST" );
793
776
unsetenv ("PGHOSTADDR" );
794
777
if (port != -1 )
795
778
{
@@ -2263,11 +2246,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
2263
2246
*/
2264
2247
header (_ ("starting postmaster" ));
2265
2248
snprintf (buf , sizeof (buf ),
2266
- SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s "
2267
- "-c \"listen_addresses=%s\" -k \"%s\" "
2268
- "> \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2269
- bindir , temp_install , debug ? " -d 5" : "" ,
2270
- hostname ? hostname : "" , sockdir ? sockdir : "" ,
2249
+ SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2250
+ bindir , temp_install ,
2251
+ debug ? " -d 5" : "" ,
2252
+ hostname ? hostname : "" ,
2271
2253
outputdir );
2272
2254
postmaster_pid = spawn_process (buf );
2273
2255
if (postmaster_pid == INVALID_PID )
0 commit comments