relation tmp_pg_shadow already exists

From: Ben Kim <bkim(at)coe(dot)tamu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: relation tmp_pg_shadow already exists
Date: 2005-01-31 16:33:00
Message-ID: Pine.GSO.4.10.10501310958030.11750-100000@edsun.coe.tamu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Operating System: Fedora core 1
From: postgresql 7.2 database
To: postgresql 7.3 database

I'm trying to restore a tar dump of postgresql 7.2 databases into a 7.3
server. I have two databases (db1,db2) both containing binary data. The
tar was dumped with the following command:

pg_dump -C -b -F t -i db1.tar db1

The first one was restored OK. But on the second one,

pg_restore -d db2 db2.tar

gives me this error.
=======================
$ pg_restore -v -d db2 db2.tar
pg_restore: connecting to database for restore
pg_restore: creating TABLE tmp_pg_shadow
pg_restore: connecting to database db2 as user u2
pg_restore: [archiver (db)] could not execute query: ERROR: Relation
'tmp_pg_shadow' already exists
pg_restore: *** aborted because of error

These are the lines containing this table name from restore.sql within the
dump tarball.
=======================
$grep tmp_pg restore.sql
DROP TABLE "".tmp_pg_shadow;
-- Name: tmp_pg_shadow; Type: TABLE; Schema: ; Owner: u2
CREATE TABLE tmp_pg_shadow (
datdba integer
);
-- Name: tmp_pg_shadow; Type: TABLE DATA; Schema: ; Owner: u2
COPY tmp_pg_shadow (datdba) FROM stdin;
copy tmp_pg_shadow (datdba) from '$$PATH$$/75.dat' ;

I found 2 questions regarding this problem from my google search, both of
them unanswered, but hope there's a way to circumvent this error, and
would appreciate any help.

Regards,

Ben Kim
Database Developer/Systems Administrator
434E Harrington Tower / College of Education
Texas A&M University

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-01-31 17:39:34 Re: relation tmp_pg_shadow already exists
Previous Message Brandon Metcalf 2005-01-31 14:52:19 corrupt table