]> granicus.if.org Git - postgresql/commitdiff
pg_receivewal: Improve verbose mode
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 16 Aug 2017 00:25:37 +0000 (20:25 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 16 Aug 2017 00:25:37 +0000 (20:25 -0400)
Some informational messages showed up even if verbose mode was not
used.  Move them to verbose mode.

Author: Michael Paquier <michael.paquier@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
src/bin/pg_basebackup/pg_receivewal.c

index 9ea61d5a5d4089151c22f9d2c1ac5892a6ee4a31..4a1a5658fb3d9a9af7a5526a1437540fc1b23273 100644 (file)
@@ -120,7 +120,7 @@ stop_streaming(XLogRecPtr xlogpos, uint32 timeline, bool segment_finished)
         * slightly before the end of the WAL that we received on the previous
         * timeline, but it's close enough for reporting purposes.
         */
-       if (prevtimeline != 0 && prevtimeline != timeline)
+       if (verbose && prevtimeline != 0 && prevtimeline != timeline)
                fprintf(stderr, _("%s: switched to timeline %u at %X/%X\n"),
                                progname, timeline,
                                (uint32) (prevpos >> 32), (uint32) prevpos);
@@ -130,8 +130,9 @@ stop_streaming(XLogRecPtr xlogpos, uint32 timeline, bool segment_finished)
 
        if (time_to_abort)
        {
-               fprintf(stderr, _("%s: received interrupt signal, exiting\n"),
-                               progname);
+               if (verbose)
+                       fprintf(stderr, _("%s: received interrupt signal, exiting\n"),
+                                       progname);
                return true;
        }
        return false;