diff options
Diffstat (limited to 'src/bin/scripts')
-rw-r--r-- | src/bin/scripts/t/020_createdb.pl | 45 | ||||
-rw-r--r-- | src/bin/scripts/t/040_createuser.pl | 6 | ||||
-rw-r--r-- | src/bin/scripts/t/090_reindexdb.pl | 21 | ||||
-rw-r--r-- | src/bin/scripts/t/100_vacuumdb.pl | 2 | ||||
-rw-r--r-- | src/bin/scripts/t/200_connstr.pl | 2 | ||||
-rw-r--r-- | src/bin/scripts/vacuumdb.c | 14 |
6 files changed, 48 insertions, 42 deletions
diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl index af3b1492e38..d0830a4a1d3 100644 --- a/src/bin/scripts/t/020_createdb.pl +++ b/src/bin/scripts/t/020_createdb.pl @@ -39,9 +39,11 @@ if ($ENV{with_icu} eq 'yes') $node->issues_sql_like( [ - 'createdb', '-T', - 'template0', '-E', 'UTF8', '--locale-provider=icu', - '--locale=C', '--icu-locale=en', 'foobar5' + 'createdb', '-T', + 'template0', '-E', + 'UTF8', '--locale-provider=icu', + '--locale=C', '--icu-locale=en', + 'foobar5' ], qr/statement: CREATE DATABASE foobar5 .* LOCALE_PROVIDER icu ICU_LOCALE 'en'/, 'create database with ICU locale specified'); @@ -56,8 +58,8 @@ if ($ENV{with_icu} eq 'yes') $node->command_fails_like( [ - 'createdb', '-T', - 'template0', '--locale-provider=icu', + 'createdb', '-T', + 'template0', '--locale-provider=icu', '--encoding=SQL_ASCII', 'foobarX' ], qr/ERROR: encoding "SQL_ASCII" is not supported with ICU provider/, @@ -65,16 +67,25 @@ if ($ENV{with_icu} eq 'yes') # additional node, which uses the icu provider my $node2 = PostgreSQL::Test::Cluster->new('icu'); - $node2->init(extra => ['--locale-provider=icu', '--icu-locale=en']); + $node2->init(extra => [ '--locale-provider=icu', '--icu-locale=en' ]); $node2->start; $node2->command_ok( - [ 'createdb', '-T', 'template0', '--locale-provider=libc', 'foobar55' ], - 'create database with libc provider from template database with icu provider'); + [ + 'createdb', '-T', + 'template0', '--locale-provider=libc', + 'foobar55' + ], + 'create database with libc provider from template database with icu provider' + ); $node2->command_ok( - [ 'createdb', '-T', 'template0', '--icu-locale', 'en-US', 'foobar56' ], - 'create database with icu locale from template database with icu provider'); + [ + 'createdb', '-T', 'template0', '--icu-locale', 'en-US', + 'foobar56' + ], + 'create database with icu locale from template database with icu provider' + ); } else { @@ -163,17 +174,11 @@ $node->issues_sql_like( [ 'createdb', '-T', 'foobar2', '-O', 'role_foobar', 'foobar8' ], qr/statement: CREATE DATABASE foobar8 OWNER role_foobar TEMPLATE foobar2/, 'create database with owner role_foobar'); -($ret, $stdout, $stderr) = $node->psql( - 'foobar2', - 'DROP OWNED BY role_foobar;', - on_error_die => 1, -); +($ret, $stdout, $stderr) = + $node->psql('foobar2', 'DROP OWNED BY role_foobar;', on_error_die => 1,); ok($ret == 0, "DROP OWNED BY role_foobar"); -($ret, $stdout, $stderr) = $node->psql( - 'foobar2', - 'DROP DATABASE foobar8;', - on_error_die => 1, -); +($ret, $stdout, $stderr) = + $node->psql('foobar2', 'DROP DATABASE foobar8;', on_error_die => 1,); ok($ret == 0, "DROP DATABASE foobar8"); done_testing(); diff --git a/src/bin/scripts/t/040_createuser.pl b/src/bin/scripts/t/040_createuser.pl index d60cae4f583..da99d0ccb92 100644 --- a/src/bin/scripts/t/040_createuser.pl +++ b/src/bin/scripts/t/040_createuser.pl @@ -34,7 +34,7 @@ $node->issues_sql_like( 'create a superuser'); $node->issues_sql_like( [ - 'createuser', '-a', + 'createuser', '-a', 'regress_user1', '-a', 'regress user2', 'regress user #4' ], @@ -42,8 +42,8 @@ $node->issues_sql_like( 'add a role as a member with admin option of the newly created role'); $node->issues_sql_like( [ - 'createuser', '-m', - 'regress_user3', '-m', + 'createuser', '-m', + 'regress_user3', '-m', 'regress user #4', 'REGRESS_USER5' ], qr/statement: CREATE ROLE "REGRESS_USER5" NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS ROLE regress_user3,"regress user #4";/, diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl index 73188739c04..b663d0e741a 100644 --- a/src/bin/scripts/t/090_reindexdb.pl +++ b/src/bin/scripts/t/090_reindexdb.pl @@ -53,7 +53,8 @@ my $fetch_toast_relfilenodes = WHERE b.oid IN ('pg_constraint'::regclass, 'test1'::regclass)}; # Same for relfilenodes of normal indexes. This saves the relfilenode # from an index of pg_constraint, and from the index of the test table. -my $fetch_index_relfilenodes = qq{SELECT i.indrelid, a.oid::regclass::text, a.oid, a.relfilenode +my $fetch_index_relfilenodes = + qq{SELECT i.indrelid, a.oid::regclass::text, a.oid, a.relfilenode FROM pg_class a JOIN pg_index i ON (i.indexrelid = a.oid) WHERE a.relname IN ('pg_constraint_oid_index', 'test1x')}; @@ -128,7 +129,7 @@ $node->issues_sql_like( 'reindex with verbose output'); $node->issues_sql_like( [ - 'reindexdb', '-v', '-t', 'test1', + 'reindexdb', '-v', '-t', 'test1', '--tablespace', $tbspace_name, 'postgres' ], qr/statement: REINDEX \(VERBOSE, TABLESPACE $tbspace_name\) TABLE public\.test1;/, @@ -171,8 +172,8 @@ $node->issues_sql_like( 'reindex with verbose output concurrently'); $node->issues_sql_like( [ - 'reindexdb', '--concurrently', '-v', '-t', - 'test1', '--tablespace', $tbspace_name, 'postgres' + 'reindexdb', '--concurrently', '-v', '-t', + 'test1', '--tablespace', $tbspace_name, 'postgres' ], qr/statement: REINDEX \(VERBOSE, TABLESPACE $tbspace_name\) TABLE CONCURRENTLY public\.test1;/, 'reindex concurrently with verbose output and tablespace'); @@ -184,7 +185,7 @@ $node->issues_sql_like( # messages. $node->command_checks_all( [ - 'reindexdb', '-t', $toast_table, '--tablespace', + 'reindexdb', '-t', $toast_table, '--tablespace', $tbspace_name, 'postgres' ], 1, @@ -193,8 +194,8 @@ $node->command_checks_all( 'reindex toast table with tablespace'); $node->command_checks_all( [ - 'reindexdb', '--concurrently', '-t', $toast_table, - '--tablespace', $tbspace_name, 'postgres' + 'reindexdb', '--concurrently', '-t', $toast_table, + '--tablespace', $tbspace_name, 'postgres' ], 1, [], @@ -202,7 +203,7 @@ $node->command_checks_all( 'reindex toast table concurrently with tablespace'); $node->command_checks_all( [ - 'reindexdb', '-i', $toast_index, '--tablespace', + 'reindexdb', '-i', $toast_index, '--tablespace', $tbspace_name, 'postgres' ], 1, @@ -211,8 +212,8 @@ $node->command_checks_all( 'reindex toast index with tablespace'); $node->command_checks_all( [ - 'reindexdb', '--concurrently', '-i', $toast_index, - '--tablespace', $tbspace_name, 'postgres' + 'reindexdb', '--concurrently', '-i', $toast_index, + '--tablespace', $tbspace_name, 'postgres' ], 1, [], diff --git a/src/bin/scripts/t/100_vacuumdb.pl b/src/bin/scripts/t/100_vacuumdb.pl index 4788c313a7f..a93782bc0dc 100644 --- a/src/bin/scripts/t/100_vacuumdb.pl +++ b/src/bin/scripts/t/100_vacuumdb.pl @@ -146,7 +146,7 @@ $node->command_fails( 'vacuumdb --min-xid-age with incorrect value'); $node->issues_sql_like( [ - 'vacuumdb', '--table', 'vactable', '--min-mxid-age', + 'vacuumdb', '--table', 'vactable', '--min-mxid-age', '2147483000', 'postgres' ], qr/GREATEST.*relminmxid.*2147483000/, diff --git a/src/bin/scripts/t/200_connstr.pl b/src/bin/scripts/t/200_connstr.pl index 18324139dbc..53c5e21ab2c 100644 --- a/src/bin/scripts/t/200_connstr.pl +++ b/src/bin/scripts/t/200_connstr.pl @@ -12,7 +12,7 @@ use Test::More; # We're going to use byte sequences that aren't valid UTF-8 strings. Use # LATIN1, which accepts any byte and has a conversion from each byte to UTF-8. -$ENV{LC_ALL} = 'C'; +$ENV{LC_ALL} = 'C'; $ENV{PGCLIENTENCODING} = 'LATIN1'; # Create database names covering the range of LATIN1 characters and diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index 687af9c1f30..4b17a070890 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -52,12 +52,12 @@ typedef struct vacuumingOptions /* object filter options */ typedef enum { - OBJFILTER_NONE = 0, /* no filter used */ - OBJFILTER_ALL_DBS = (1 << 0), /* -a | --all */ - OBJFILTER_DATABASE = (1 << 1), /* -d | --dbname */ - OBJFILTER_TABLE = (1 << 2), /* -t | --table */ - OBJFILTER_SCHEMA = (1 << 3), /* -n | --schema */ - OBJFILTER_SCHEMA_EXCLUDE = (1 << 4) /* -N | --exclude-schema */ + OBJFILTER_NONE = 0, /* no filter used */ + OBJFILTER_ALL_DBS = (1 << 0), /* -a | --all */ + OBJFILTER_DATABASE = (1 << 1), /* -d | --dbname */ + OBJFILTER_TABLE = (1 << 2), /* -t | --table */ + OBJFILTER_SCHEMA = (1 << 3), /* -n | --schema */ + OBJFILTER_SCHEMA_EXCLUDE = (1 << 4) /* -N | --exclude-schema */ } VacObjFilter; VacObjFilter objfilter = OBJFILTER_NONE; @@ -83,7 +83,7 @@ static void run_vacuum_command(PGconn *conn, const char *sql, bool echo, static void help(const char *progname); -void check_objfilter(void); +void check_objfilter(void); /* For analyze-in-stages mode */ #define ANALYZE_NO_STAGE -1 |