# Failing to connect to the initial database due to bad username is an error.
$node->command_checks_all(
[ 'pg_amcheck', '--username' => 'no_such_user', 'postgres' ],
- 1, [qr/^$/], [], 'checking with a non-existent user');
+ 1,
+ [qr/^$/],
+ [qr/role "no_such_user" does not exist/],
+ 'checking with a non-existent user');
#########################################
# Test checking databases without amcheck installed
qr/statement: CLUSTER;/,
'SQL CLUSTER run');
-$node->command_fails([ 'clusterdb', '--table' => 'nonexistent' ],
+$node->command_fails_like(
+ [ 'clusterdb', '--table' => 'nonexistent' ],
+ qr/relation "nonexistent" does not exist/,
'fails with nonexistent table');
$node->safe_psql('postgres',
qr/statement: DROP DATABASE foobar2 WITH \(FORCE\);/,
'SQL DROP DATABASE (FORCE) run');
-$node->command_fails([ 'dropdb', 'nonexistent' ],
+$node->command_fails_like(
+ [ 'dropdb', 'nonexistent' ],
+ qr/database "nonexistent" does not exist/,
'fails with nonexistent database');
# check that invalid database can be dropped with dropdb
qr/statement: DROP ROLE regress_foobar1/,
'SQL DROP ROLE run');
-$node->command_fails([ 'dropuser', 'regress_nonexistent' ],
+$node->command_fails_like(
+ [ 'dropuser', 'regress_nonexistent' ],
+ qr/role "regress_nonexistent" does not exist/,
'fails with nonexistent user');
done_testing();