aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2008-05-03 23:32:32 +0000
committerAndrew Dunstan <andrew@dunslane.net>2008-05-03 23:32:32 +0000
commit17a56c0b55c9bd71c42a9d4c59b06e7bb2e77e60 (patch)
treed9a016e5cf2aeda99889011662a40a4534d48e5f
parentc88850f4a07dc95b4143808bec3f12ace66179d9 (diff)
downloadpostgresql-17a56c0b55c9bd71c42a9d4c59b06e7bb2e77e60.tar.gz
postgresql-17a56c0b55c9bd71c42a9d4c59b06e7bb2e77e60.zip
Disable statement timeouts while making or restoring dumps.
Joshua Drake.
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c7
-rw-r--r--src/bin/pg_dump/pg_dump.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 7a8588cdf6e..09c96a71ce9 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.154 2008/04/13 03:49:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.155 2008/05/03 23:32:32 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -220,6 +220,11 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
}
/*
+ * Disable statement_timeout in archive for pg_restore/psql
+ */
+ ahprintf(AH, "SET statement_timeout = 0;\n");
+
+ /*
* Establish important parameter values right away.
*/
_doSetFixedOutputState(AH);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index dbc3a191b5e..f7ac1706de8 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.488 2008/04/14 17:05:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.489 2008/05/03 23:32:32 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -571,6 +571,12 @@ main(int argc, char **argv)
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.
*/
do_sql_command(g_conn, "BEGIN");