Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 250AC9FBD08 for ; Tue, 19 Jun 2007 14:12:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 20284-01 for ; Tue, 19 Jun 2007 14:12:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5AE8C9FBAC7 for ; Tue, 19 Jun 2007 14:12:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5JHCBUK007517; Tue, 19 Jun 2007 13:12:11 -0400 (EDT) To: Karl Wright cc: pgsql-admin@postgresql.org Subject: Re: Export/import issue/question In-reply-to: <4677F3D2.6050909@metacarta.com> References: <4677F3D2.6050909@metacarta.com> Comments: In-reply-to Karl Wright message dated "Tue, 19 Jun 2007 11:18:42 -0400" Date: Tue, 19 Jun 2007 13:12:10 -0400 Message-ID: <7516.1182273130@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/183 X-Sequence-Number: 25851 Karl Wright 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