Disable statement timeouts while making or restoring dumps.
authorAndrew Dunstan <andrew@dunslane.net>
Sat, 3 May 2008 23:32:32 +0000 (23:32 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Sat, 3 May 2008 23:32:32 +0000 (23:32 +0000)
Joshua Drake.

src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_dump.c

index e6c343ced586bdf8fb8ef60f054e2e3c24e93f49..3c8fe7f178236ad345521e6bde4c30b29b572b43 100644 (file)
@@ -219,6 +219,11 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
                        ahprintf(AH, "BEGIN;\n\n");
        }
 
+       /*
+        * Disable statement_timeout in archive for pg_restore/psql
+        */
+       ahprintf(AH, "SET statement_timeout = 0;\n");
+
        /*
         * Establish important parameter values right away.
         */
index 36ba4575c584874a39aacae5b4323d222d052f97..e2eb44859d3b1ac9af322a5d8453b7e3e2df130a 100644 (file)
@@ -570,6 +570,12 @@ main(int argc, char **argv)
        if (g_fout->remoteVersion >= 80300)
                do_sql_command(g_conn, "SET synchronize_seqscans TO off");
 
+       /*
+        * Disable timeouts if supported.
+        */
+       if (g_fout->remoteVersion >= 70300)
+               do_sql_command(g_conn, "SET statement_timeout = 0");
+         
        /*
         * Start serializable transaction to dump consistent data.
         */