diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 931872ba45..25683a7841 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