From: Tom Lane <tgl@sss.pgh.pa.us>
To: Karl Wright <kwright@metacarta.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Export/import issue/question
Date: Tue, 19 Jun 2007 13:12:10 -0400
Message-ID: <7516.1182273130@sss.pgh.pa.us> (raw)
In-Reply-To: <4677F3D2.6050909@metacarta.com>
References: <4677F3D2.6050909@metacarta.com>
Karl Wright <kwright@metacarta.com> writes:
> and then I installed 8.1, and attempted the following:
> pg_restore --file dbsnapshot --format=t --table=ingeststatus -a
> But, I get the following error:
> pg_restore: [tar archiver] could not find header for file toc.dat in tar
> archive
Oh, I'm overthinking the problem. You left out some details here,
right? Like it sat and did nothing until you hit control-D?
The above command is wrong because --file is an *output* switch for
pg_restore --- it would have tried to read a tar archive from stdin,
and the "could not find header" complaint is what you get when it hits
immediate EOF and the tar format has been forced on the command line.
(You would have gotten a more recognizable complaint without --format=t,
which is redundant anyway.) Fortunately, it doesn't seem to try to
write the output file right away, so the dumpfile didn't get trashed.
Correct usage would be something like
pg_restore --table=ingeststatus -a dbsnapshot >restore.sql
or add -d etc switches to issue SQL directly to the target database.
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, kwright@metacarta.com
Subject: Re: Export/import issue/question
In-Reply-To: <7516.1182273130@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