Doc: add commentary about cowboy assignment of maintenance_work_mem.
[pgsql.git] / src / bin / scripts / t / 101_vacuumdb_all.pl
blob74cb22dc3416cd9140f16fab8b5535d8b2b5b07a
2 # Copyright (c) 2021-2025, PostgreSQL Global Development Group
4 use strict;
5 use warnings FATAL => 'all';
7 use PostgreSQL::Test::Cluster;
8 use Test::More;
10 my $node = PostgreSQL::Test::Cluster->new('main');
11 $node->init;
12 $node->start;
14 $node->issues_sql_like(
15 [ 'vacuumdb', '--all' ],
16 qr/statement: VACUUM.*statement: VACUUM/s,
17 'vacuum all databases');
19 $node->safe_psql(
20 'postgres', q(
21 CREATE DATABASE regression_invalid;
22 UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid';
23 ));
24 $node->command_ok([ 'vacuumdb', '--all' ],
25 'invalid database not targeted by vacuumdb -a');
27 # Doesn't quite belong here, but don't want to waste time by creating an
28 # invalid database in 010_vacuumdb.pl as well.
29 $node->command_fails_like(
30 [ 'vacuumdb', '--dbname' => 'regression_invalid' ],
31 qr/FATAL: cannot connect to invalid database "regression_invalid"/,
32 'vacuumdb cannot target invalid database');
34 done_testing();