@@ -109,7 +109,6 @@ static const char *progname;
109109static char * logfilename ;
110110static FILE * logfile ;
111111static char * difffilename ;
112- static char * sockdir ;
113112
114113static _resultmap * resultmap = NULL ;
115114
@@ -760,7 +759,8 @@ initialize_environment(void)
760759 * the wrong postmaster, or otherwise behave in nondefault ways. (Note
761760 * we also use psql's -X switch consistently, so that ~/.psqlrc files
762761 * 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.
764764 */
765765 unsetenv ("PGDATABASE" );
766766 unsetenv ("PGUSER" );
@@ -772,24 +772,7 @@ initialize_environment(void)
772772 if (hostname != NULL )
773773 doputenv ("PGHOST" , hostname );
774774 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" );
793776 unsetenv ("PGHOSTADDR" );
794777 if (port != -1 )
795778 {
@@ -2266,11 +2249,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
22662249 */
22672250 header (_ ("starting postmaster" ));
22682251 snprintf (buf , sizeof (buf ),
2269- SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s "
2270- "-c \"listen_addresses=%s\" -k \"%s\" "
2271- "> \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2272- bindir , temp_install , debug ? " -d 5" : "" ,
2273- hostname ? hostname : "" , sockdir ? sockdir : "" ,
2252+ SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE ,
2253+ bindir , temp_install ,
2254+ debug ? " -d 5" : "" ,
2255+ hostname ? hostname : "" ,
22742256 outputdir );
22752257 postmaster_pid = spawn_process (buf );
22762258 if (postmaster_pid == INVALID_PID )
0 commit comments