Re: pg_restore with -j fails (works without -j option)

From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore with -j fails (works without -j option)
Date: 2011-08-26 14:55:03
Message-ID: CAP=oouHTDku7Scv+2SkCRYJK3q7GZKDw8GVM4+-_QxOQurNwVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 25, 2011 at 7:41 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Lonni J Friedman <netllama(at)gmail(dot)com> writes:
>> [ this doesn't work: ]
>> $ cat 2011-08-25-1314280801-nightly.out | pg_restore -j2 -U lfriedman -v -d nightly
>
> It's basically impossible for that to work.  -j implies spawning
> multiple processes that will be wanting to read concurrently from
> different places in the input file.  That cannot happen when the source
> is a pipe.  In this particular example, the pipe construct isn't even
> doing anything useful; you could perfectly well write this instead:
>
> $ pg_restore -j2 -U lfriedman -v -d nightly 2011-08-25-1314280801-nightly.out

Indeed, that works perfectly. thanks!

>
>
>> pg_restore: [custom archiver] cannot reopen stdin
>> pg_restore: *** aborted because of error
>
> I agree though that that's not a terribly friendly error message.
> I thought we had some code in there to complain about non-seekable
> input files, but it looks like we missed a case.

Let me know if you need more details from me to fix this.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pasman pasmański 2011-08-26 15:14:59 Re: COPY FROM how long should take ?
Previous Message Maton, Brett 2011-08-26 14:37:48 Re: Postgresql 9.0.4 SRPMS