2 # Copyright (c) 2021-2025, PostgreSQL Global Development Group
5 use warnings FATAL
=> 'all';
7 use PostgreSQL
::Test
::Cluster
;
8 use PostgreSQL
::Test
::Utils
;
11 program_help_ok
('dropuser');
12 program_version_ok
('dropuser');
13 program_options_handling_ok
('dropuser');
15 my $node = PostgreSQL
::Test
::Cluster
->new('main');
19 $node->safe_psql('postgres', 'CREATE ROLE regress_foobar1');
20 $node->issues_sql_like(
21 [ 'dropuser', 'regress_foobar1' ],
22 qr/statement: DROP ROLE regress_foobar1/,
25 $node->command_fails_like(
26 [ 'dropuser', 'regress_nonexistent' ],
27 qr/role "regress_nonexistent" does not exist/,
28 'fails with nonexistent user');