summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/regress/pg_regress.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 931872ba45a..25683a78413 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2277,6 +2277,17 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
optind++;
}
+ /*
+ * We must have a database to run the tests in; either a default name, or
+ * one supplied by the --dbname switch.
+ */
+ if (!(dblist && dblist->str && dblist->str[0]))
+ {
+ fprintf(stderr, _("%s: no database name was specified\n"),
+ progname);
+ exit(2);
+ }
+
if (config_auth_datadir)
{
#ifdef ENABLE_SSPI