From d43837d03067487560af481474ae985df894f786 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 16 Mar 2013 23:22:17 -0400 Subject: Add lock_timeout configuration parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This GUC allows limiting the time spent waiting to acquire any one heavyweight lock. In support of this, improve the recently-added timeout infrastructure to permit efficiently enabling or disabling multiple timeouts at once. That reduces the performance hit from turning on lock_timeout, though it's still not zero. Zoltán Böszörményi, reviewed by Tom Lane, Stephen Frost, and Hari Babu --- src/bin/pg_dump/pg_backup_archiver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/bin/pg_dump/pg_backup_archiver.c') diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index d500bfd234..19d12788d9 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2592,9 +2592,12 @@ _tocEntryIsACL(TocEntry *te) static void _doSetFixedOutputState(ArchiveHandle *AH) { - /* Disable statement_timeout in archive for pg_restore/psql */ + /* Disable statement_timeout since restore is probably slow */ ahprintf(AH, "SET statement_timeout = 0;\n"); + /* Likewise for lock_timeout */ + ahprintf(AH, "SET lock_timeout = 0;\n"); + /* Select the correct character set encoding */ ahprintf(AH, "SET client_encoding = '%s';\n", pg_encoding_to_char(AH->public.encoding)); -- cgit v1.2.1