From bf0945e8636bf0390ef4569bbbf9763573211e03 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon, 11 Jun 2012 21:55:48 -0400
Subject: [PATCH] Fix pg_dump output to a named tar-file archive.

"pg_dump -Ft -f filename ..." got broken by my recent commit
4317e0246c645f60c39e6572644cff1cb03b4c65, which I fear I only tested
in the output-to-stdout variant.

Report and fix by Muhammad Asif Naeem.
---
 src/bin/pg_dump/pg_backup_tar.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index c5e19968b7c..67527b75850 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -862,6 +862,7 @@ _CloseArchive(ArchiveHandle *AH)
 
 		ropt = NewRestoreOptions();
 		memcpy(ropt, AH->ropt, sizeof(RestoreOptions));
+		ropt->filename = NULL;
 		ropt->dropSchema = 1;
 		ropt->compression = 0;
 		ropt->superuser = NULL;
-- 
GitLab