Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4D4262E0081 for ; Wed, 20 Feb 2008 19:32:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55830-03 for ; Wed, 20 Feb 2008 19:31:58 -0400 (AST) Received: from oxford.xeocode.com (unknown [87.127.95.194]) by postgresql.org (Postfix) with ESMTP id 1F2192E0089 for ; Wed, 20 Feb 2008 19:31:58 -0400 (AST) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.69) (envelope-from ) id 1JRyPl-0000ws-Ul; Wed, 20 Feb 2008 23:31:50 +0000 To: "Tom Lane" Cc: "Erik Jones" , "Douglas J Hunley" , "Jeff" , "Richard Huxton" , Subject: Re: 7 hrs for a pg_restore? In-Reply-To: <9755.1203526446@sss.pgh.pa.us> (Tom Lane's message of "Wed\, 20 Feb 2008 11\:54\:06 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX" 65417) References: <200802191303.58840.doug@hunley.homeip.net> <200802191555.43340.doug@hunley.homeip.net> <080DA59E-2C02-4370-8584-FA7C8CC008B0@myemma.com> <200802200826.38611.doug@hunley.homeip.net> <874pc3ww96.fsf@oxford.xeocode.com> <0C5E3C24-530F-40AD-8CB4-B0477A368F6E@myemma.com> <9755.1203526446@sss.pgh.pa.us> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 20 Feb 2008 23:31:49 +0000 Message-ID: <87zltvurve.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/257 X-Sequence-Number: 28799 "Tom Lane" writes: > Erik Jones writes: >> On Feb 20, 2008, at 8:14 AM, Gregory Stark wrote: >>> I would suggest leaving out the && which only obfuscate what's >>> going on here. >>> >>> PGOPTIONS=... pg_restore ... >>> >>> would work just as well and be clearer about what's going on. > >> Right, that's just an unnecessary habit of mine. > > Isn't that habit outright wrong? ISTM that with the && in there, > what you're doing is equivalent to > > PGOPTIONS=whatever > pg_restore ... > > This syntax will set PGOPTIONS for the remainder of the shell session, > causing it to also affect (say) a subsequent psql invocation. Which is > exactly not what is wanted. When I said "obfuscating" I meant it. I'm pretty familiar with sh scripting and I'm not even sure what the && behaviour would do. On at least some shells I think the && will introduce a subshell. In that case the variable would not continue. In bash I think it would because bash avoids a lot of subshells that would otherwise be necessary. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!