@@ -106,7 +106,6 @@ static const char *progname;
106
106
static char * logfilename ;
107
107
static FILE * logfile ;
108
108
static char * difffilename ;
109
- static char * sockdir ;
110
109
111
110
static _resultmap * resultmap = NULL ;
112
111
@@ -764,7 +763,8 @@ initialize_environment(void)
764
763
* the wrong postmaster, or otherwise behave in nondefault ways. (Note
765
764
* we also use psql's -X switch consistently, so that ~/.psqlrc files
766
765
* won't mess things up.) Also, set PGPORT to the temp port, and set
767
- * PGHOST depending on whether we are using TCP or Unix sockets.
766
+ * or unset PGHOST depending on whether we are using TCP or Unix
767
+ * sockets.
768
768
*/
769
769
unsetenv ("PGDATABASE" );
770
770
unsetenv ("PGUSER" );
@@ -776,24 +776,7 @@ initialize_environment(void)
776
776
if (hostname != NULL )
777
777
doputenv ("PGHOST" , hostname );
778
778
else
779
- {
780
- sockdir = getenv ("PG_REGRESS_SOCK_DIR" );
781
- if (!sockdir )
782
- {
783
- /*
784
- * Since initdb creates the data directory with secure
785
- * permissions, we place the socket there. This ensures no
786
- * other OS user can open our socket to exploit our use of
787
- * trust authentication. Compared to using the compiled-in
788
- * DEFAULT_PGSOCKET_DIR, this also permits testing to work in
789
- * builds that relocate it to a directory not writable to the
790
- * build/test user.
791
- */
792
- sockdir = malloc (strlen (temp_install ) + sizeof ("/data" ));
793
- sprintf (sockdir , "%s/data" , temp_install );
794
- }
795
- doputenv ("PGHOST" , sockdir );
796
- }
779
+ unsetenv ("PGHOST" );
797
780
unsetenv ("PGHOSTADDR" );
798
781
if (port != -1 )
799
782
{
@@ -2220,11 +2203,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
2220
2203
*/
2221
2204
header (_ ("starting postmaster" ));
2222
2205
snprintf (buf , sizeof (buf ),
2223
- SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s "
2224
- "-c \"listen_addresses=%s\" -k \"%s\" "
2225
- "> \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2226
- bindir , temp_install , debug ? " -d 5" : "" ,
2227
- hostname ? hostname : "" , sockdir ? sockdir : "" ,
2206
+ SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2207
+ bindir , temp_install ,
2208
+ debug ? " -d 5" : "" ,
2209
+ hostname ? hostname : "" ,
2228
2210
outputdir );
2229
2211
postmaster_pid = spawn_process (buf );
2230
2212
if (postmaster_pid == INVALID_PID )
0 commit comments