aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/t/010_clusterdb.pl
blob: fe22cdbb4e4e86c544b5d8e27e1c45b58f963da0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;
use TestLib;
use Test::More tests => 6;

program_help_ok('clusterdb');
program_version_ok('clusterdb');
program_options_handling_ok('clusterdb');

my $tempdir = tempdir;
start_test_server $tempdir;

issues_sql_like(
	[ 'clusterdb', 'postgres' ],
	qr/statement: CLUSTER;/,
	'SQL CLUSTER run');

command_fails([ 'clusterdb', '-t', 'nonexistent', 'postgres' ],
	'fails with nonexistent table');

psql 'postgres',
'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x';
issues_sql_like(
	[ 'clusterdb', 'postgres', '-t', 'test1' ],
	qr/statement: CLUSTER test1;/,
	'cluster specific table');