From: Kevin Grittner Date: Mon, 29 Nov 2010 14:47:22 +0000 (-0600) Subject: Fix pg_dump breakage on older versions. X-Git-Url: http://git.postgresql.org/gitweb/static/developers.postgresql.org?a=commitdiff_plain;h=9543aa4e08cf78f127bbd2ea9a1a3da2cbf6970d;p=users%2Fkgrittn%2Fpostgres.git Fix pg_dump breakage on older versions. Since REPEATABLE READ and READ ONLY weren't known in all versions we want to dump, and they won't matter until SSI is present, condision the setting of transaction characteristics based on the backend version. --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 1a7ac90fa1..36766fb80f 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -669,7 +669,11 @@ main(int argc, char **argv) /* * Start transaction-snapshot mode transaction to dump consistent data. */ - do_sql_command(g_conn, "BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY;"); + do_sql_command(g_conn, "BEGIN"); + if (g_fout->remoteVersion < 90100) + do_sql_command(g_conn, "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"); + else + do_sql_command(g_conn, "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY"); /* Select the appropriate subquery to convert user IDs to names */ if (g_fout->remoteVersion >= 80100)