]> granicus.if.org Git - postgresql/commitdiff
In pg_dump, show server and pg_dump versions with or without --verbose.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2014 23:02:45 +0000 (19:02 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2014 23:02:45 +0000 (19:02 -0400)
We used to print this information only in verbose mode, but it's argued
that it's useful enough to print always; one reason being that this
provides some documentation about which Postgres versions the dump is
meant to reload into.

Jing Wang, reviewed by Jeevan Chalke

src/bin/pg_dump/pg_backup_archiver.c

index f6fbf4442da2f8f5af083a5767a50b4c4db5215d..3aebac87272bb995d6271425d82e6580d4c10053 100644 (file)
@@ -353,16 +353,17 @@ RestoreArchive(Archive *AHX)
 
        ahprintf(AH, "--\n-- PostgreSQL database dump\n--\n\n");
 
+       if (AH->archiveRemoteVersion)
+               ahprintf(AH, "-- Dumped from database version %s\n",
+                                AH->archiveRemoteVersion);
+       if (AH->archiveDumpVersion)
+               ahprintf(AH, "-- Dumped by pg_dump version %s\n",
+                                AH->archiveDumpVersion);
+
+       ahprintf(AH, "\n");
+
        if (AH->public.verbose)
-       {
-               if (AH->archiveRemoteVersion)
-                       ahprintf(AH, "-- Dumped from database version %s\n",
-                                        AH->archiveRemoteVersion);
-               if (AH->archiveDumpVersion)
-                       ahprintf(AH, "-- Dumped by pg_dump version %s\n",
-                                        AH->archiveDumpVersion);
                dumpTimestamp(AH, "Started on", AH->createDate);
-       }
 
        if (ropt->single_txn)
        {