Skip to content

Commit 7700597

Browse files
committed
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
1 parent 3088cc3 commit 7700597

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,16 +353,17 @@ RestoreArchive(Archive *AHX)
353353

354354
ahprintf(AH, "--\n-- PostgreSQL database dump\n--\n\n");
355355

356+
if (AH->archiveRemoteVersion)
357+
ahprintf(AH, "-- Dumped from database version %s\n",
358+
AH->archiveRemoteVersion);
359+
if (AH->archiveDumpVersion)
360+
ahprintf(AH, "-- Dumped by pg_dump version %s\n",
361+
AH->archiveDumpVersion);
362+
363+
ahprintf(AH, "\n");
364+
356365
if (AH->public.verbose)
357-
{
358-
if (AH->archiveRemoteVersion)
359-
ahprintf(AH, "-- Dumped from database version %s\n",
360-
AH->archiveRemoteVersion);
361-
if (AH->archiveDumpVersion)
362-
ahprintf(AH, "-- Dumped by pg_dump version %s\n",
363-
AH->archiveDumpVersion);
364366
dumpTimestamp(AH, "Started on", AH->createDate);
365-
}
366367

367368
if (ropt->single_txn)
368369
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy