diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index 1bb738f7f3..3480b6edc5 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -62,6 +62,7 @@ BEGIN delete $ENV{LC_ALL}; $ENV{LC_MESSAGES} = 'C'; + # This list should be kept in sync with pg_regress.c. my @envkeys = qw ( PGCLIENTENCODING PGCONNECT_TIMEOUT diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 2c469413a3..1e4015b072 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -800,14 +800,32 @@ initialize_environment(void) * we also use psql's -X switch consistently, so that ~/.psqlrc files * won't mess things up.) Also, set PGPORT to the temp port, and set * PGHOST depending on whether we are using TCP or Unix sockets. + * + * This list should be kept in sync with TestLib.pm. */ - unsetenv("PGDATABASE"); - unsetenv("PGUSER"); - unsetenv("PGSERVICE"); - unsetenv("PGSSLMODE"); - unsetenv("PGREQUIRESSL"); + /* PGCLIENTENCODING, see above */ unsetenv("PGCONNECT_TIMEOUT"); unsetenv("PGDATA"); + unsetenv("PGDATABASE"); + unsetenv("PGGSSLIB"); + /* PGHOSTADDR, see below */ + unsetenv("PGKRBSRVNAME"); + unsetenv("PGPASSFILE"); + unsetenv("PGPASSWORD"); + unsetenv("PGREQUIREPEER"); + unsetenv("PGREQUIRESSL"); + unsetenv("PGSERVICE"); + unsetenv("PGSERVICEFILE"); + unsetenv("PGSSLCERT"); + unsetenv("PGSSLCRL"); + unsetenv("PGSSLKEY"); + unsetenv("PGSSLMODE"); + unsetenv("PGSSLROOTCERT"); + unsetenv("PGTARGETSESSIONATTRS"); + unsetenv("PGUSER"); + /* PGPORT, see below */ + /* PGHOST, see below */ + #ifdef HAVE_UNIX_SOCKETS if (hostname != NULL) doputenv("PGHOST", hostname);