Re: 7 hrs for a pg_restore?

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Erik Jones" <erik(at)myemma(dot)com>, "Douglas J Hunley" <doug(at)hunley(dot)homeip(dot)net>, "Jeff" <threshar(at)threshar(dot)is-a-geek(dot)com>, "Richard Huxton" <dev(at)archonet(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: 7 hrs for a pg_restore?
Date: 2008-02-20 23:31:49
Message-ID: 87zltvurve.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Erik Jones <erik(at)myemma(dot)com> 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!

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Chris 2008-02-20 23:35:16 Re: 7 hrs for a pg_restore?
Previous Message Tom Lane 2008-02-20 18:46:55 Re: 7 hrs for a pg_restore?