pg_restore bug in 7.4.1 ? - Mailing list pgsql-hackers

From Fabien COELHO
Subject pg_restore bug in 7.4.1 ?
Date
Msg-id Pine.LNX.4.58.0402021619080.5480@sablons.cri.ensmp.fr
Whole thread Raw
Responses Re: pg_restore bug in 7.4.1 ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello,

I think I have found a feature of pg_restore that may be a bug.

If the --clean option AND --dbname=database option are used with an
initially empty database, the restoration fails, although the very same
options with a "| psql database" works fine.

The internal psql with --dbname option fails at the generated clean
stuff if the database is empty, as the ALTER and DROP tables are
reported to fail and the generation is stopped. In the piped version,
these initial errors are ignored.

sh> createdb comics
sh> pg_restore --clean --no-owner --no-acl --dbname=comics comics.dbz
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.a_ecrit" does not exist

However it works fine without the "--clean" option.

It seems that the instruction that fails is :
ALTER TABLE ONLY public.a_ecrit DROP CONSTRAINT "$2";

It would make sense to ignore some alter/drop errors in pg_restore.

-- 
Fabien Coelho - coelho@cri.ensmp.fr


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: pg_stat_activity
Next
From: Bruce Momjian
Date:
Subject: Re: Idea about better configuration options for sort memory