pg_restore bug in 7.4.1 ?

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_restore bug in 7.4.1 ?
Date: 2004-02-02 15:44:55
Message-ID: Pine.LNX.4.58.0402021619080.5480@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cri(dot)ensmp(dot)fr

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-02-02 16:02:39 Re: Idea about better configuration options for sort memory
Previous Message Jan Wieck 2004-02-02 15:33:42 Re: [HACKERS] What's left?