pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: daveg <daveg@sonic.net>
Cc: pgsql-patches@postgresql.org
Cc: hari@efrontier.com
Subject: Re: pg_dump lock timeout
Date: Mon, 21 Jul 2008 03:43:11 -0400
Message-ID: <3279.1216626191@sss.pgh.pa.us> (raw)
In-Reply-To: <20080721072131.GE30869@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>

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.

> Finally, you changed the option value and case from 1 to case 2. getopt_long
> only returns the value argument when there is no flag to set, so 1 was unique
> and could have been read as "the first no-short option with an argument".

Yeah.  The code *worked* as you submitted it, but what was bothering me
was that the "val = 1" table entries worked in two completely different
ways for the different argument types.  I first thought that you'd
broken the existing long argument options --- you hadn't, but I had to
go re-read the getopt_long source to convince myself of that.  So it
seemed like using a different "val" value might help clarify the
difference in behavior for future readers of the code.  In particular
the next guy who wants to add a long option with parameter value would
certainly not be able to use val = 1; but I thought the code as you
had it wouldn't give him any clue what to do.  If you've got a better
idea about how to deal with that, feel free...

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <3279.1216626191@sss.pgh.pa.us>
Permalink:  ../3279.1216626191@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3279.1216626191@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, daveg@sonic.net, hari@efrontier.com
  Subject: Re: pg_dump lock timeout
  In-Reply-To: <3279.1216626191@sss.pgh.pa.us>

* 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