aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/t/002_pg_dump.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/t/002_pg_dump.pl')
-rw-r--r--src/bin/pg_dump/t/002_pg_dump.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 695baccf841..32c3e066666 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -1575,6 +1575,17 @@ my %tests = (
},
},
+ 'CREATE DATABASE regression_invalid...' => {
+ create_order => 1,
+ create_sql => q(
+ CREATE DATABASE regression_invalid;
+ UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid'),
+ regexp => qr/^CREATE DATABASE regression_invalid/m,
+ not_like => {
+ pg_dumpall_dbprivs => 1,
+ },
+ },
+
'CREATE ACCESS METHOD gist2' => {
create_order => 52,
create_sql =>
@@ -4029,6 +4040,14 @@ command_fails_like(
'connecting to a non-existent database');
#########################################
+# Test connecting to an invalid database
+
+$node->command_fails_like(
+ [ 'pg_dump', '-d', 'regression_invalid' ],
+ qr/pg_dump: error: connection to server .* failed: FATAL: cannot connect to invalid database "regression_invalid"/,
+ 'connecting to an invalid database');
+
+#########################################
# Test connecting with an unprivileged user
command_fails_like(