aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/postmaster/autovacuum.c12
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c7
-rw-r--r--src/bin/pg_dump/pg_dump.c2
3 files changed, 14 insertions, 7 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 2c7446b4a43..3768f50bcf3 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -538,11 +538,13 @@ AutoVacLauncherMain(int argc, char *argv[])
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_OVERRIDE);
/*
- * Force statement_timeout and lock_timeout to zero to avoid letting these
- * settings prevent regular maintenance from being executed.
+ * Force settable timeouts off to avoid letting these settings prevent
+ * regular maintenance from being executed.
*/
SetConfigOption("statement_timeout", "0", PGC_SUSET, PGC_S_OVERRIDE);
SetConfigOption("lock_timeout", "0", PGC_SUSET, PGC_S_OVERRIDE);
+ SetConfigOption("idle_in_transaction_session_timeout", "0",
+ PGC_SUSET, PGC_S_OVERRIDE);
/*
* Force default_transaction_isolation to READ COMMITTED. We don't want
@@ -1551,11 +1553,13 @@ AutoVacWorkerMain(int argc, char *argv[])
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_OVERRIDE);
/*
- * Force statement_timeout and lock_timeout to zero to avoid letting these
- * settings prevent regular maintenance from being executed.
+ * Force settable timeouts off to avoid letting these settings prevent
+ * regular maintenance from being executed.
*/
SetConfigOption("statement_timeout", "0", PGC_SUSET, PGC_S_OVERRIDE);
SetConfigOption("lock_timeout", "0", PGC_SUSET, PGC_S_OVERRIDE);
+ SetConfigOption("idle_in_transaction_session_timeout", "0",
+ PGC_SUSET, PGC_S_OVERRIDE);
/*
* Force default_transaction_isolation to READ COMMITTED. We don't want
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index eadc874f952..796a0aa7168 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -2859,11 +2859,12 @@ _doSetFixedOutputState(ArchiveHandle *AH)
{
RestoreOptions *ropt = AH->public.ropt;
- /* Disable statement_timeout since restore is probably slow */
+ /*
+ * Disable timeouts to allow for slow commands, idle parallel workers, etc
+ */
ahprintf(AH, "SET statement_timeout = 0;\n");
-
- /* Likewise for lock_timeout */
ahprintf(AH, "SET lock_timeout = 0;\n");
+ ahprintf(AH, "SET idle_in_transaction_session_timeout = 0;\n");
/* Select the correct character set encoding */
ahprintf(AH, "SET client_encoding = '%s';\n",
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 0f1f6e9f93b..13bfd2cfb93 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1022,6 +1022,8 @@ setup_connection(Archive *AH, const char *dumpencoding,
ExecuteSqlStatement(AH, "SET statement_timeout = 0");
if (AH->remoteVersion >= 90300)
ExecuteSqlStatement(AH, "SET lock_timeout = 0");
+ if (AH->remoteVersion >= 90600)
+ ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.