Hi Shibagaki-san,

Good catch!

> In dump_one_relation(), the limit line is printed before the existing
> quiet check. The attached patch adds a quiet check to that output while
> preserving parsing and error detection.

It might be matter of taste, but how about moving printf() after the `if 
(opt->quiet)`?
The code might be clearer.

> The patch also adds TAP coverage for -q and --quiet and checks that a
> truncated input file is still rejected. The pg_walsummary tests pass
> with the patch.

```
+# --quiet must also suppress limit blocks caused by relation creation.
+my $summary_dir = $node1->data_dir . '/pg_wal/summaries';
+my @summaries = map { "$summary_dir/$_" }
+  sort grep { /^[0-9A-F]{40}\.summary$/ } slurp_dir($summary_dir);
+command_like(
+       [ 'pg_walsummary', @summaries ],
+       qr/: limit 0$/m,
+       'relation creation produces limit blocks');
+for my $option ('-q', '--quiet')
+{
+       command_checks_all(
+               [ 'pg_walsummary', $option, @summaries ],
+               0,
+               [qr/\A\z/],
+               [qr/\A\z/],
+               "$option suppresses all output");
+}
```

I feel it's enough to call command_checks_all() once, thought?

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Reply via email to