From 1cf13e6f3645261af7731ab308129154f6f65b62 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon, 13 Feb 2006 21:30:19 +0000
Subject: [PATCH] IMHO, --single-transaction should wrap *all* the commands in
 BEGIN/COMMIT, not just some of them.

---
 src/bin/pg_dump/pg_backup_archiver.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index dff02d67cee..0000b3a00a3 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.123 2006/02/12 06:11:50 momjian Exp $
+ *		$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.124 2006/02/13 21:30:19 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -213,6 +213,9 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
 	if (AH->public.verbose)
 		dumpTimestamp(AH, "Started on", AH->createDate);
 
+	if (ropt->single_txn)
+		ahprintf(AH, "BEGIN;\n\n");
+
 	/*
 	 * Establish important parameter values right away.
 	 */
@@ -220,9 +223,6 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
 
 	AH->stage = STAGE_PROCESSING;
 
-    if (ropt->single_txn)
-		ahprintf(AH, "BEGIN;\n\n");
-
 	/*
 	 * Drop the items at the start, in reverse order
 	 */
@@ -376,7 +376,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
 		}
 	}
 
-    if (ropt->single_txn)
+	if (ropt->single_txn)
 		ahprintf(AH, "COMMIT;\n\n");
 
 	if (AH->public.verbose)
-- 
GitLab