Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8C8AD64FCD2 for ; Tue, 22 Jul 2008 02:57:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 78716-02 for ; Tue, 22 Jul 2008 02:57:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from a.mail.sonic.net (a.mail.sonic.net [64.142.16.245]) by postgresql.org (Postfix) with ESMTP id 6CE4364FCD8 for ; Tue, 22 Jul 2008 02:57:39 -0300 (ADT) Received: from newshell.sonic.net (bolt.sonic.net [208.201.242.19]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id m6M5vZ5s015356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jul 2008 22:57:35 -0700 Received: from bolt.sonic.net (IDENT:uQrGmEjRlsqWlgW95bqmzV04zv89gYx+@localhost.localdomain [127.0.0.1]) by newshell.sonic.net (8.13.6/8.12.1) with ESMTP id m6M5vZ7u022724; Mon, 21 Jul 2008 22:57:35 -0700 Received: (from daveg@localhost) by bolt.sonic.net (8.13.6/8.12.1/Submit) id m6M5vZEH022723; Mon, 21 Jul 2008 22:57:35 -0700 Date: Mon, 21 Jul 2008 22:57:35 -0700 From: daveg To: Tom Lane Cc: pgsql-patches@postgresql.org, hari@efrontier.com Subject: Re: pg_dump lock timeout Message-ID: <20080722055735.GW30869@sonic.net> References: <20080511113047.GV5673@sonic.net> <20080511130035.GW5673@sonic.net> <20080702155626.GC30328@fetter.org> <20080717024407.GL11471@sonic.net> <13580.1216579850@sss.pgh.pa.us> <20080721072131.GE30869@sonic.net> <3279.1216626191@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <3279.1216626191@sss.pgh.pa.us> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/220 X-Sequence-Number: 6914 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 21, 2008 at 03:43:11AM -0400, Tom Lane wrote: > daveg writes: > > On Sun, Jul 20, 2008 at 02:50:50PM -0400, Tom Lane wrote: > >> In most cases our policy has been that pg_dumpall should accept and pass > >> through any pg_dump option for which it's sensible to do so. I did not > >> make that happen but it seems it'd be a reasonable follow-on patch. > > > I'll remember that next time. > > Er .. actually that was a direct request for you to do it. Attached is a the followon patch for pg_dumpall and docs to match pg_dump. On a second topic, is anyone working on a parallel dump/load? I'd be interested in helping. -dg -- David Gould daveg@sonic.net 510 536 1443 510 282 0869 If simplicity worked, the world would be overrun with insects. --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pg-dumpall-timeout.patch" *** a/doc/src/sgml/ref/pg_dumpall.sgml --- b/doc/src/sgml/ref/pg_dumpall.sgml *************** *** 196,201 **** PostgreSQL documentation --- 196,217 ---- + + + + Do not wait forever to acquire shared table locks at the beginning of + the dump. Instead fail if unable to lock a table within the specified + timeout. The timeout may be + specified in any of the formats accepted by SET + statement_timeout. (Allowed values vary depending on the server + version you are dumping from, but an integer number of milliseconds + is accepted by all versions since 7.3. This option is ignored when + dumping from a pre-7.3 server.) + + + + + *** a/src/bin/pg_dump/pg_dumpall.c --- b/src/bin/pg_dump/pg_dumpall.c *************** *** 120,125 **** main(int argc, char *argv[]) --- 120,126 ---- {"disable-triggers", no_argument, &disable_triggers, 1}, {"no-tablespaces", no_argument, &no_tablespaces, 1}, {"use-set-session-authorization", no_argument, &use_setsessauth, 1}, + {"lock-wait-timeout", required_argument, NULL, 2}, {NULL, 0, NULL, 0} }; *************** *** 305,310 **** main(int argc, char *argv[]) --- 306,316 ---- case 0: break; + case 2: + appendPQExpBuffer(pgdumpopts, " --lock-wait-timeout="); + appendPQExpBuffer(pgdumpopts, optarg); + break; + default: fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname); exit(1); *************** *** 488,493 **** help(void) --- 494,500 ---- printf(_(" -f, --file=FILENAME output file name\n")); printf(_(" --help show this help, then exit\n")); printf(_(" --version output version information, then exit\n")); + printf(_(" --lock-wait-timeout=TIMEOUT fail after waiting TIMEOUT for a table lock\n")); printf(_("\nOptions controlling the output content:\n")); printf(_(" -a, --data-only dump only the data, not the schema\n")); printf(_(" -c, --clean clean (drop) databases prior to create\n")); --d6Gm4EdcadzBjdND--