From edba754f052ea0c02287080004aa6051eaa4f597 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 18 Mar 2025 16:32:56 -0500 Subject: vacuumdb: Add option for analyzing only relations missing stats. This commit adds a new --missing-stats-only option that can be used with --analyze-only or --analyze-in-stages. When this option is specified, vacuumdb will analyze a relation if it lacks any statistics for a column, expression index, or extended statistics object. This new option is primarily intended for use after pg_upgrade (since it can now retain most optimizer statistics), but it might be useful in other situations, too. Author: Corey Huinker Co-authored-by: Nathan Bossart Reviewed-by: John Naylor Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan --- src/test/perl/PostgreSQL/Test/Cluster.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/test/perl/PostgreSQL') diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index bab3f3d2dbe..05bd94609d4 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -2849,6 +2849,33 @@ sub issues_sql_like =pod +=item $node->issues_sql_unlike(cmd, unexpected_sql, test_name) + +Run a command on the node, then verify that $unexpected_sql does not appear in +the server log file. + +=cut + +sub issues_sql_unlike +{ + local $Test::Builder::Level = $Test::Builder::Level + 1; + + my ($self, $cmd, $unexpected_sql, $test_name) = @_; + + local %ENV = $self->_get_env(); + + my $log_location = -s $self->logfile; + + my $result = PostgreSQL::Test::Utils::run_log($cmd); + ok($result, "@$cmd exit code 0"); + my $log = + PostgreSQL::Test::Utils::slurp_file($self->logfile, $log_location); + unlike($log, $unexpected_sql, "$test_name: SQL not found in server log"); + return; +} + +=pod + =item $node->log_content() Returns the contents of log of the node -- cgit v1.2.3