From: daveg <daveg@sonic.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-patches@postgresql.org
Cc: hari@efrontier.com
Subject: Re: pg_dump lock timeout
Date: Mon, 21 Jul 2008 22:57:35 -0700
Message-ID: <20080722055735.GW30869@sonic.net> (raw)
In-Reply-To: <3279.1216626191@sss.pgh.pa.us>
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>
On Mon, Jul 21, 2008 at 03:43:11AM -0400, Tom Lane wrote:
> daveg <daveg@sonic.net> 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.
Attachments:pg-dumpall-timeout.patch (text/plain, 2.4K) download
*** a/doc/src/sgml/ref/pg_dumpall.sgml
--- b/doc/src/sgml/ref/pg_dumpall.sgml
***************
*** 196,201 **** PostgreSQL documentation
--- 196,217 ----
</varlistentry>
<varlistentry>
+ <term><option>--lock-wait-timeout=<replaceable class="parameter">timeout</replaceable></option></term>+ <listitem>+ <para>+ 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+ <replaceable class="parameter">timeout</>. The timeout may be+ specified in any of the formats accepted by <command>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.)+ </para>+ </listitem>+ </varlistentry>+ + <varlistentry>
<term><option>--no-tablespaces</option></term>
<listitem>
<para>
*** 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"));
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-patches@postgresql.org
Cc: daveg@sonic.net, tgl@sss.pgh.pa.us, hari@efrontier.com
Subject: Re: pg_dump lock timeout
In-Reply-To: <20080722055735.GW30869@sonic.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox