Kevin Grittner <kgri...@ymail.com> wrote:
> Tom Lane <t...@sss.pgh.pa.us> wrote:

>> A comment seems essential here, because as written anybody would 
>> think the test for a snapshot is a bug.
>
> Good point.

I propose to apply the attached to master and back-patch to 9.3, 
and follow that with a patch (for master only) along the lines 
suggested by Andres.  Since *that* change is more invasive and 
changes existing behavior I will submit it to the open CF for 
review.  Objections?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index c3ebb3a..6d57fe0 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1011,7 +1011,17 @@ setup_connection(Archive *AH, DumpOptions *dopt, const char *dumpencoding,
 	ExecuteSqlStatement(AH, "BEGIN");
 	if (AH->remoteVersion >= 90100)
 	{
-		if (dopt->serializable_deferrable)
+		if (dopt->serializable_deferrable &&
+			/*
+			 * To support the combination of this option with the jobs option
+			 * we use REPEATABLE READ for the worker connections that are
+			 * passed a snapshot.  As long as the snapshot is acquired in a
+			 * SERIALIZABLE, READ ONLY, DEFERRABLE transaction, its use within
+			 * a REPEATABLE READ transaction provides the appropriate
+			 * integrity guarantees.  This is a kluge, but safe for
+			 * back-patching.
+			 */
+			AH->sync_snapshot_id == NULL)
 			ExecuteSqlStatement(AH,
 								"SET TRANSACTION ISOLATION LEVEL "
 								"SERIALIZABLE, READ ONLY, DEFERRABLE");
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to