relation tmp_pg_shadow already exists - Mailing list pgsql-admin

From Ben Kim
Subject relation tmp_pg_shadow already exists
Date
Msg-id Pine.GSO.4.10.10501310958030.11750-100000@edsun.coe.tamu.edu
Whole thread Raw
Responses Re: relation tmp_pg_shadow already exists
List 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



pgsql-admin by date:

Previous
From: Brandon Metcalf
Date:
Subject: corrupt table
Next
From: Tom Lane
Date:
Subject: Re: relation tmp_pg_shadow already exists