aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-09-27 18:19:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2019-09-27 18:19:37 -0400
commit5ee96b3e2221d154ffcb719bd2dee1179c53f821 (patch)
tree5ba7a040c0bd7004675b7bc6889c9644fe80407b
parent3f6b3be39ca91a62b88051a6b4fdf428a05c6b0d (diff)
downloadpostgresql-5ee96b3e2221d154ffcb719bd2dee1179c53f821.tar.gz
postgresql-5ee96b3e2221d154ffcb719bd2dee1179c53f821.zip
Make pg_regress.c unset PGDATABASE during make installcheck.
For the most part, we leave libpq-controlling environment variables alone during "make installcheck", reasoning that connecting to the server the user expects us to connect to may depend on those variables. But that argument doesn't apply to PGDATABASE, since we always want to connect to a specific database name within the server. And failing to unset it causes certain ECPG tests to fail, as various people have complained of in the past. So let's unset it. Possibly this should be back-patched, but I'm disinclined to do that right before 12.0 release. Maybe later. Discussion: https://postgr.es/m/20180318205548.2akxjqvo7hrk5wbc@alap3.anarazel.de Discussion: https://postgr.es/m/E1bOum4-0002EA-2y@gemulon.postgresql.org
-rw-r--r--src/test/regress/pg_regress.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index b4045abf219..3a394721088 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -862,6 +862,14 @@ initialize_environment(void)
doputenv("PGUSER", user);
/*
+ * However, we *don't* honor PGDATABASE, since we certainly don't wish
+ * to connect to whatever database the user might like as default.
+ * (Most tests override PGDATABASE anyway, but there are some ECPG
+ * test cases that don't.)
+ */
+ unsetenv("PGDATABASE");
+
+ /*
* Report what we're connecting to
*/
pghost = getenv("PGHOST");