diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-06-13 20:08:06 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-06-13 20:08:06 +0900 |
commit | 1df6bee296ed2be0fda11ee7aa42853cf0469f8d (patch) | |
tree | 0786fe19282f72efba3558552e4cfd11568b028c /src/test/regress/pg_regress.c | |
parent | c1ffbbcbca93b3544c0b57b7ab063497794cb8ff (diff) |
Ignore more environment variables in pg_regress.c
This is similar to the work done in 8279f68 for TestLib.pm, where
environment variables set may cause unwanted failures if using a
temporary installation with pg_regress. The list of variables reset is
adjusted in each stable branch depending on what is supported.
Comments are added to remember that the lists in TestLib.pm and
pg_regress.c had better be kept in sync.
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/YMNR9GYDn+fHlMta@paquier.xyz
Backpatch-through: 9.6
Diffstat (limited to 'src/test/regress/pg_regress.c')
-rw-r--r-- | src/test/regress/pg_regress.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 56f277bef69..8c9f13c812a 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -797,14 +797,31 @@ 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. */ + /* PGCLIENTENCODING, see above */ + unsetenv("PGCONNECT_TIMEOUT"); + unsetenv("PGDATA"); unsetenv("PGDATABASE"); - unsetenv("PGUSER"); + 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("PGREQUIRESSL"); - unsetenv("PGCONNECT_TIMEOUT"); - unsetenv("PGDATA"); + unsetenv("PGSSLROOTCERT"); + unsetenv("PGUSER"); + /* PGPORT, see below */ + /* PGHOST, see below */ + #ifdef HAVE_UNIX_SOCKETS if (hostname != NULL) doputenv("PGHOST", hostname); |