|
103 | 103 | CREATE TABLE funcidx (x int);
|
104 | 104 | INSERT INTO funcidx VALUES (0),(1),(2),(3);
|
105 | 105 | CREATE INDEX i0 ON funcidx ((f1(x)));
|
| 106 | + CREATE SCHEMA "Foo"; |
| 107 | + CREATE TABLE "Foo".bar(id int); |
106 | 108 | |);
|
107 | 109 | $node->command_ok([qw|vacuumdb -Z --table="need""q(uot"(")x") postgres|],
|
108 | 110 | 'column list');
|
|
146 | 148 | [ 'vacuumdb', '--min-xid-age', '2147483001', 'postgres' ],
|
147 | 149 | qr/GREATEST.*relfrozenxid.*2147483001/,
|
148 | 150 | 'vacuumdb --table --min-xid-age');
|
| 151 | +$node->issues_sql_like( |
| 152 | + [ 'vacuumdb', '--schema', '"Foo"', 'postgres' ], |
| 153 | + qr/VACUUM "Foo".bar/, |
| 154 | + 'vacuumdb --schema'); |
| 155 | +$node->issues_sql_like( |
| 156 | + [ 'vacuumdb', '--exclude-schema', '"Foo"', 'postgres' ], |
| 157 | + qr/(?:(?!VACUUM "Foo".bar).)*/, |
| 158 | + 'vacuumdb --exclude-schema'); |
| 159 | +$node->command_fails_like( |
| 160 | + [ 'vacuumdb', '-N', 'pg_catalog', '-t', 'pg_class', 'postgres', ], |
| 161 | + qr/cannot vacuum specific table\(s\) and exclude schema\(s\) at the same time/, |
| 162 | + 'cannot use options -N and -t at the same time'); |
| 163 | +$node->command_fails_like( |
| 164 | + [ 'vacuumdb', '-n', 'pg_catalog', '-t', 'pg_class', 'postgres' ], |
| 165 | + qr/cannot vacuum all tables in schema\(s\) and specific table\(s\) at the same time/, |
| 166 | + 'cannot use options -n and -t at the same time'); |
| 167 | +$node->command_fails_like( |
| 168 | + [ 'vacuumdb', '-n', 'pg_catalog', '-N', '"Foo"', 'postgres' ], |
| 169 | + qr/cannot vacuum all tables in schema\(s\) and exclude schema\(s\) at the same time/, |
| 170 | + 'cannot use options -n and -N at the same time'); |
| 171 | +$node->command_fails_like( |
| 172 | + [ 'vacuumdb', '-a', '-N', '"Foo"' ], |
| 173 | + qr/cannot exclude specific schema\(s\) in all databases/, |
| 174 | + 'cannot use options -a and -N at the same time'); |
| 175 | +$node->command_fails_like( |
| 176 | + [ 'vacuumdb', '-a', '-n', '"Foo"' ], |
| 177 | + qr/cannot vacuum specific schema\(s\) in all databases/, |
| 178 | + 'cannot use options -a and -n at the same time'); |
| 179 | +$node->command_fails_like( |
| 180 | + [ 'vacuumdb', '-a', '-t', '"Foo".bar' ], |
| 181 | + qr/cannot vacuum specific table\(s\) in all databases/, |
| 182 | + 'cannot use options -a and -t at the same time'); |
| 183 | +$node->command_fails_like( |
| 184 | + [ 'vacuumdb', '-a', '-d', 'postgres' ], |
| 185 | + qr/cannot vacuum all databases and a specific one at the same time/, |
| 186 | + 'cannot use options -a and -d at the same time'); |
| 187 | +$node->command_fails_like( |
| 188 | + [ 'vacuumdb', '-a', 'postgres' ], |
| 189 | + qr/cannot vacuum all databases and a specific one at the same time/, |
| 190 | + 'cannot use option -a and a dbname as argument at the same time'); |
149 | 191 |
|
150 | 192 | done_testing();
|
0 commit comments