diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-07-07 19:02:45 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-07-07 19:02:45 -0400 |
commit | 7700597b34fbb26e377f419271f65be1c13c518f (patch) | |
tree | bf8dbd3081315ab6c23090b070004262ff5f6b4d | |
parent | 3088cc37044a303fc50857d8d9e7e44b5c250642 (diff) | |
download | postgresql-7700597b34fbb26e377f419271f65be1c13c518f.tar.gz postgresql-7700597b34fbb26e377f419271f65be1c13c518f.zip |
In pg_dump, show server and pg_dump versions with or without --verbose.
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
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index f6fbf4442da..3aebac87272 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -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) { |